The Song–Đại Việt war, also known as the Lý-Song War, was a military conflict between the Lý dynasty of Đại Việt and the Song dynasty of China between 1075 and 1077. The war was sparked by the shifting allegiances of tribal peoples such as the Zhuang/Nùng on the frontier borderlands, and increasing state control over their administration. In 1075, Emperor Lý Nhân Tông ordered a preemptive invasion of Song dynasty territory with more than 80,000 soldiers, razing the city of Yongzhou after a 42-day siege. The Song retaliated with an army of 300,000 the following year. In 1077, Song forces nearly reached Đại Việt's capital Thăng Long before being halted by General Lý Thường Kiệt at the Như Nguyệt River in modern-day Bắc Ninh Province.
After a prolonged stalemate and high casualties on both sides, Lý Thường Kiệt offered apologies for the invasion and the Song commander Guo Kui agreed to withdraw his troops, ending the war. Further negotiations were held in the following years that consolidated the border between the two empires.
Background
Nùng Trí Cao rebellions
In the 1040s and 1050s, the Nong Zhigao rebellions of the Zhuang/Nùng leader Nùng Trí Cao (C. Nong Zhigao) in Quảng Nguyên (C. Guangyuan; now Cao Bằng Province) and his attempt to create an independent state on the borderlands of Đại Cồ Việt and the Song dynasty led to intensified relations between the two states. Nùng Trí Cao's failed rebellions and defeat by Viet forces and the Song general Di Qing (1008–1061) resulted in the removal of the tribal buffer zone between Đại Cồ Việt and the Song. His final defeat by the Song also had the effect of subordinating a large portion of that zone to direct Song control. The Viet court did not intervene in the matter and for 20 years after the Nùng Trí Cao rebellions, there was general peace along the border. However the regional power balance had been lost. Han Chinese military settlers moved in and new leaders took over the surviving communities. Several influential Nùng leaders sided with the Viet court. Crucial influences for the lead up to the event include the Song-court sponsored New Policies promoted by Wang Anshi and efforts by the Lý court to consolidate peripheral fiefdoms.
The Song and Đại Cồ Việt treated their frontier borderland peoples in different ways. Traditionally the Chinese Jimi system sought to introduce "uncultured" barbarians to the benefits of the "civilized" center. Viet leadership on the other hand created "patron-client" relationships using marriage alliances and military expeditions to maintain "satellite" partners. Successive Viet courts saw the extraction of resources from frontier vassals as a measurement of their efficacy. However by the 11th century, both the Chinese and Viet courts saw the frontier as a source of available troops famed for their ferocity. By 1065, around 44,500 militia had been recruited from these communities by the Song.
Song expansion
Frontier unrest began anew in 1057 when Nùng Tông Ðán (C. Nong Zongdan), a kinsman of Nùng Trí Cao, entered Song territory. The frontier administrator Wang Han visited Nùng Tông Ðán's camp at Leihuo (in Quang Nguyên) to discourage him from seeking inclusion in the Song dynasty since it would upset the Viet court. Instead he proposed that he stay outside Song territory as a loyal frontier militia leader. Wang feared that a resurgence of the Nùng clan would spell trouble for the frontier. The Song court ignored his apprehensions and offered the Nùng and other communities "Interior Dependency" status. By 1061, Emperor Renzong of Song (r. 1022-63) was regretting his decision and lamented that the "Nùng Bandit" and his kin had strayed far from their frontier duties and might never be incorporated into the Song administration. However in 1062 when Nùng Tông Ðán requested his territory be incorporated into the Song empire, Renzong accepted his request. According to The Draft Documents Pertaining to Song Official Matters, Nùng Tông Ðán was regarded by the Song as the prefect of Leihuo prefecture, renamed "Pacified Prefecture" (Shun'anzhou), and possessed the title "Personal Guardian General of the Right." Nùng Trí Hội (C. Nong Zhihui) the brother of Nùng Trí Cao, received the title "Personal Guardian of the Left." Other members of the Nùng clan in Temo such as Nùng Binh, Năng Lượng, and Nùng Hạ Khanh swore loyalty to the Song. Nùng Trí Cao's former generals Lư Báo, Lê Mạo, and Hoàng Trọng Khanh were also granted official titles.
In the view of the Song court, these titles were not merely honorary appointments. Local militia in the southwestern frontier zone was reorganized in 1065 under Guizhou prefect Lu Shen. The 45 grottoes along the You and Zuo rivers were assigned grotto militia leaders. A commissioner surveyed the region for able-bodied men to be organized under a guard commander selected from the area's prominent households, who received a specific signal banner to indicate their group's distinction. Groups of 30 men were organized into local governance units known as "tithings (jia)", which were organized in groups of five under a troop commandant (dutou), groups of ten led by an aboriginal commander (zhijunshi), and in groups of 50 led by a commander-in-chief (duzhijunshi). It was perhaps this intensification of border defense that the Viet court felt threatened by, as it saw its own systems of local control eroded.
Scholars also note that there was a sharp increase in the population of the Song dynasty's southwest frontier by the end of the 11th century. At the end of the 10th c., this region counted only 17,760 households while the same area had increased to 56,596 households in 1078-85. Guangnan West Circuit's population in 1080 stood at 287,723 households, a 133% increase from the Tang census of 742. Some of the increase can be attributed to including indigenous populations and improved recording methods, but the trend of increased Han Chinese settlement is clear. With the increase of Han Chinese population also came more northern-oriented cultural practices.
Before the Tang, this county was settled by the Miao barbarian people. There were no traces of Han settlers. In 1053, The ‘Great Martial Leader’ Di (Qing) put down the rebellion of the Quang Nguyên barbarian Nùng Trí Cao, the troops following the general’s expedition remained in the region to open up and settle the wasteland. Their settlements extended throughout this county.
— A Record of Fengshan County
Viet expansion
The Lý court was also in the process of consolidating its frontier. In 1059, efforts were made to take direct control of the frontier and its manpower. The northern frontier in the Zuo-You river region was divided into new administrative units: Ngự Long, Vũ Thắng, Long Dực, Thần Ðiện, Bổng Thánh, Bảo Thắng, Hùng Lược, and Vạn Tiệp. Each of these units was assigned an official. Militia units were established among local communities. Conscripts had the character "Army of the Son of Heaven" (tianzi jun) tattooed on their foreheads. This reflected a distinctly Southeast Asian way of controlling regional manpower.
Border conflicts
In the early 1060s border conflicts began to occur along the Song-Viet frontier. In the spring of 1060, the chieftain of Lạng Châu and imperial in-law, Thàn Thiệu Tháị, crossed into Song territory to raid for cattle. Thiệu Tháị captured the Song commander Yang Baocai in the attack. In autumn of 1060, Song forces also crossed the border but were unsuccessful in recovering Yang. Fighting caused by the natives led by Thiệu Tháị claimed the lives of five military inspectors. The military commissioner Yu Jing sought aid from Champa for a joint attack on Quảng Nguyên. The Lý court caught wind of this and began directly courting local leaders.
Despite increased military tensions, the Lý court sought to defuse the situation by sending a delegation led by Bi Gia Dụ to Yongzhou. The Song authorities requested the return of Yang Baocai but was denied. Emperor Renzong was also wary of further increasing tensions and instructed the local military commissions to refrain from assembling troops. On 8 February 1063, two tributary envoys from the Lý court presented to the Song emperor nine tame elephants. On 7 April 1063, the new Song emperor Yingzong (r. 1063-67) sent calligraphic compositions by Renzong as gifts to the Lý court.
On the same day the Viet envoy Lý Kế Tiên prepared to depart Kaifeng, news arrived that Thàn Thiệu Tháị had attacked settlements in Guangnan West Circuit. A Guangnan official requested immediate retaliation against the southern intruders. However the Song court tried to distance Thiệu Tháị's actions from the Lý court. An envoy from Thăng Long arrived seeking forgiveness for the attack. Yingzong decided not to retaliate.
On 18 November 1064, the Guizhou prefect Lu Shen reported that a military delegation from Thăng Long had crossed the border seeking Nùng Nhật Tân , the son of Nùng Tông Ðán. He also reported that the delegation showed interest in encroaching on Song territory, including Wenmen dong (Hurun, a village in Jingxi, Guangxi). The Song court took no particular action but Lu was determined to expand Song military presence in the south. Lu raised 44,500 troops from 45 aboriginal leaders along the Zuo-You River region and ordered them to repair and fortify military defenses. To gain the local trust, he requested special seals be made for his militia leaders and that the Zuo-You region be exempt from taxes. The Viet officials became concerned about this development and sent a tribute envoy to Kaifeng to remind the Song court of the Viet role in settling frontier matters. Meanwhile Lu proposed a special training and indoctrination program for a local chieftain each year that would see them enter the official bureaucracy after three years.
Shifting alliances
In late 1065, Nùng Tông Ðán switched allegiance from the Song and proposed an alliance with Lý Thánh Tông (r. 1054–1072) and Quảng Nguyên chieftain Lưu Ký (C. Liu Ji). Lu Shen reported this to court, but Yingzong did not take any action other than to reassign Nùng Tông Ðán's titles. To offset Tông Ðán's defection, the Song bestowed titles on Nùng Trí Hội and acknowledged him as the sole leader of Quảng Nguyên.
Emperor Shenzong of Song (r. 1067–1085) continued to pay special attention to Viet envoys in January and February 1067. He presented the envoys with a grand array of gifts: 200 liang of silver ingots, 300 bolts of silk, two horses, and a saddle with inlaid gold and silver plating. He called Lý Thánh Tông the "King of the Southern Pacified Region." At the same time Song officials on the southern frontier were training for military action. By late 1067, the Guizhou prefect Zhang Tian reported that Lưu Ký was in communication with Lư Báo, who had crossed into Song territory to seek personal glory. Zhang wished to attack Lư Báo but the Song court rejected this course of action. However by 1069, Lư Báo had offered his allegiance to the Song while Lưu Ký remained in Quảng Nguyên and was nominally under the control of Thăng Long.
In late 1071, the Guangnan military commissioner Xiao Gu reported that Lưu Ký had been spotted near Shun'anzhou (in Quảng Nguyên) at the head of more than 200 men. The Song court expressed concerns that forces were being amassed by barbarians.
On 2 February 1072, Lý Thánh Tông died. The new ruler, Lý Nhân Tông (r. 1072–1128), was only six years old. His regents, such as the defender-in-chief Lý Thường Kiệt, consolidated power by announcing a general amnesty for all outlaws in the protected prefectures. It was reported that the local chieftain of Lạng Châu, Dương Cảnh Thông, brought to court a white deer as tribute and was rewarded with the title "Grand Guardian."
In 1073, a group from the "Five Clans" sent a large tribute embassy numbering 890 to the Song court.
New Policies
In the late 1060s, Wang Anshi's New Policies and the prevalent sentiment of irredentism in Shenzong's court led to new ways of governing. Wang's policies saw each part of society as part of a greater whole, and thus the state must take a more holistic and all-encompassing part in governance. One of Wang's reforms, the Balanced Delivery Law, called on fiscal intendants in six of the southern circuits to disregard quotas on tribute items and to buy and sell items according to prices on the open market. Loyal supporters were sought out to assist in the extraction of these resources. Lý Thường Kiệt viewed the changing economic relationship between the Song and its frontier people as an abandonment of the traditional tribute paradigm. Wang called for military action from Song imperial troops.
In early 1075, Thăng Long requested the return of an upland chieftain who had gone over to the Song with 700 followers. The Song refused, saying that they had submitted to the Song.