Although sporadic conflicts would continue, the Northern Song lost their land border with the Western Xia after the Jin–Song wars and the Jingkang Incident of 1127 which saw the fall of their capital, Kaifeng, to the Jurchen-led Jin dynasty.
In 982, the ruler of the Dingnan Jiedushi, Li Jipeng, decided to submit to the Song dynasty and exchange his title for a comfortable existence in Kaifeng.
In 1032, Yuanhao annexed the Tibetan confederation of Xiliangfu, and soon after his father died, leaving him ruler of the Tangut state.
These were mounted forces, which had been stretched thin by hard warfare and probably excessive use of non-warrior horsemen impressed to fill the army.
[8] Despite the defenders' mediocre performance, Yuanhao was forced to lift the siege and retreat to a ring of forts overlooking Yanzhou, when heavy winter snows set in.
[10][11] Despite such victories, Yuanhao failed to make any headway against Song fortifications, garrisoned by 200,000 troops on rotation from the capital,[12] and remained unable to seize any territory.
[14] The defending commander Ge Huaimin lost his nerve and decided to run, abandoning his 19,000 troops to be slaughtered.
Half his soldiers had died from attrition and after two years, Western Xia could no longer support his military endeavors.
[17] By 1043, there were several hundred thousand trained local archer and crossbow militiamen in Shaanxi, and their archery skills were now generally effective.
[18]The Liao dynasty took advantage of the Song's dire predicaments by increasing annual tribute payments by 100,000 units of silk and silver (each).
[19] Liao forces enjoyed an initial victory but failed to take the Xia capital and were brutally mauled by Yuanhao's defenders.
[21] Having exhausted his resources, Yuanhao made peace with the Song, who recognized his rights to Xia lands as king and agreed to pay an annual tribute of 250,000 units of silk, silver, and tea.
[22] Yizong regrouped at Qingtang and launched another attack on Qingzhou in December but withdrew after threats by Emperor Yingzong of Song to escalate the conflict.
After initial victories, Song forces failed to take the capital of Xia, Xingqing, and remained on the defensive for the next three years.
[27][28] On 15 October, Liu Changzuo's 50,000 strong army met a Xia force of 30,000 led by the Empress Regent Liang's brother.
[29] Liu's vanguard attacked the town's gate before the defenders had a chance to close it, dealing several hundred casualties, and seizing more than 1,000 cattle before retreating.
Gao relayed his version of events to the Song court, then had Liu removed from command, merging the two forces.
[31] On 8 December, Gao Zunyu decided to attack Lingzhou, only to realize he had forgotten to bring any siege equipment, and there were not enough trees around for their construction.
[31] In September 1082, the Xia counterattacked with a 300,000 strong army, laying siege to Yongle, a fortress town west of Mizhi.
The defending commander, Wang Wenyu, led a small contingent out at night and made a surprise attack on the Xia encampment, forcing them to retreat.
[34] Advance and fortify was a Song dynasty military strategy and campaign to seize Western Xia lands in the northwest.
The campaign centered on fortifying key locations along river valleys and mountains to erode the Xia position.
In 1096, the Song stopped paying tribute to the Xia, and the next year launched a two-pronged "advance and fortify" campaign.
The Tangut army was completely defeated in their attempt to dislodge the Song from their high ground position, and their generals Weiming Amai and Meiledubu were both captured.
Failing to take major cities, the Tangut forces went on a rampage, killing tens of thousands of local civilians.
The next year Emperor Chongzong of Western Xia made peace with the Song, but was unable to clearly demarcate their borders, leading to another war in 1113.
[36] In 1113, the Western Xia started building fortifications in disputed territory with the Song dynasty, and took the Qingtang region.
In 1115, 150,000 troops under the command of Liu Fa penetrated deep into Xia territory and slaughtered the Tangut garrison at Gugulong.
He gave orders for Liu Fa to lead 200,000 into the heart of the Xia empire, aiming straight at the capital region.
The Tangut army surrounded the Song forces, killing half of them, with the remaining falling back during the night.