Jin–Song wars
The Jin–Song Wars were a series of conflicts between the Jurchen-led Jin dynasty and the Han-led Song dynasty. In 1115, Jurchen tribes rebelled against their overlords, the Khitan-led Liao dynasty, and declared the formation of the Jin. Allying with the Song against their common enemy the Liao dynasty, the Jin promised to cede to the Song the Sixteen Prefectures that had fallen under Liao control since 938. The Song agreed but the Jin's quick defeat of the Liao combined with Song military failures made the Jin reluctant to cede territory. After a series of negotiations that embittered both sides, the Jurchens attacked the Song in 1125, dispatching one army to Taiyuan and the other to Bianjing, the Song capital.
Surprised by news of an invasion, Song general Tong Guan retreated from Taiyuan, which was besieged and later captured. As the second Jin army approached the capital, Song emperor Huizong abdicated and fled south. Qinzong, his eldest son, was enthroned. The Jin dynasty laid siege to Kaifeng in 1126, but Qinzong negotiated their retreat from the capital by agreeing to a large annual indemnity. Qinzong reneged on the deal and ordered Song forces to defend the prefectures instead of fortifying the capital. The Jin resumed war and again besieged Kaifeng in 1127. They captured Qinzong, many members of the imperial family and high officials of the Song imperial court in an event known as the Jingkang Incident. This separated north and south China between Jin and Song. Remnants of the Song imperial family retreated to southern China and, after brief stays in several temporary capitals, eventually relocated to Lin'an. The retreat divided the dynasty into two distinct periods, Northern Song and Southern Song.
The Jurchens tried to conquer southern China in the 1130s but were bogged down by a pro-Song insurgency in the north and a counteroffensive by Song generals, including Yue Fei and Han Shizhong. The Song generals regained some territories but retreated on the orders of Southern Song emperor Gaozong, who supported a peaceful resolution to the war. The Treaty of Shaoxing set the boundary of the two empires along the Huai River, but conflicts between the two dynasties continued until the fall of Jin in 1234. A war against the Song begun by the 4th Jin emperor, Wanyan Liang, was unsuccessful. He lost the Battle of Caishi and was later assassinated by his own disaffected officers. An invasion of Jin territory motivated by Song revanchism was also unsuccessful. A decade later, Jin launched an abortive military campaign against the Song in 1217 to replace territory they had lost to the invading Mongols. The Song allied with the Mongols in 1233, and in the next year jointly captured Caizhou, the last refuge of the Jin emperor. The Jin dynasty collapsed that year. After the demise of Jin, the Song became a target of the Mongols, and collapsed in 1279.
The wars engendered an era of swift technological, cultural, and demographic changes in China. Battles between the Song and Jin brought about the introduction of various gunpowder weapons. The siege of De'an in 1132 was the first recorded use of the fire lance, an early ancestor of firearms. There were also reports of incendiary huopao or the exploding tiehuopao, incendiary arrows, and other related weapons. In northern China, Jurchens were the ruling minority of an empire predominantly inhabited by former subjects of the Song. Jurchen migrants settled in the conquered territories and assimilated with the local culture. Jin, a conquest dynasty, instituted a centralized imperial bureaucracy modeled on previous Chinese dynasties, basing their legitimacy on Confucian philosophy. Song refugees from the north resettled in southern China. The north was the cultural center of China, and its conquest by Jin diminished the regional stature of the Song dynasty. The Southern Song, however, quickly returned to economic prosperity, and trade with Jin was lucrative despite decades of warfare. Lin'an, the Southern Song capital, expanded into a major city for commerce.
Fragile Song–Jin alliance
The Jurchens were a Tungusic-speaking group of semi-agrarian tribes inhabiting areas of northeast Asia that are now part of Northeast China. Many of the Jurchen tribes were vassals of the Liao dynasty, an empire ruled by the nomadic Khitans that included most of modern Mongolia, a portion of North China, Northeast China, northern Korea, and parts of the Russian Far East. To the south of the Liao lay the Han Chinese Song Empire. The Song and Liao were at peace, but since a military defeat to the Liao in 1005, the Song paid its northern neighbor an annual indemnity of 200,000 bolts of silk and 100,000 ounces of silver. Before the Jurchens overthrew the Khitan, married Jurchen women and Jurchen girls were raped by Liao Khitan envoys as a custom which caused resentment by the Jurchens against the Khitan. Song princesses committed suicide to avoid rape or were killed for resisting rape by the Jin.In 1114, the chieftain Wanyan Aguda united the disparate Jurchen tribes and led a revolt against the Liao. In 1115 he named himself emperor of the Jin "golden" dynasty. Informed by a Liao defector of the success of the Jurchen uprising, the Song emperor Huizong and his highest military commander the eunuch Tong Guan saw the Liao weakness as an opportunity to recover the Sixteen Prefectures, a line of fortified cities and passes that the Liao had annexed from the Shatuo Turk Later Jin in 938, and that the Song had repeatedly but unsuccessfully tried to reconquer. The Song thus sought an alliance with the Jin against their common enemy the Liao.
File:Wanggiyan Aguda.jpg|thumb|left|200px|Jurchen chieftain Wanyan Aguda, who in 1115 became first emperor of the Jin dynasty
Because the land routes between the Song and Jin were controlled by the Liao, diplomatic exchanges had to occur by traveling across the Bohai Sea. Negotiations for an alliance began secretly under the pretense that the Song wanted to acquire horses from the Khitans. Song diplomats traveled to the Jin court to meet Aguda in 1118, while Jurchen envoys arrived in the Song capital Kaifeng the next year. At the beginning, the two sides agreed to keep whatever Liao territory they would seize in combat. In 1120, Aguda agreed to cede the Sixteen Prefectures to the Song in exchange for transfer to the Jin of the annual tributary payments that the Song had been giving the Liao. By the end of 1120, however, the Jurchens had seized the Liao Supreme Capital, and offered the Song only parts of the Sixteen Prefectures. Among other things, Jin would keep the Liao Western Capital of Datong at the western end of the Sixteen Prefectures. The two sides agreed that the Jin would now attack the Liao Central Capital, whereas the Song would seize the Liao Southern Capital, Yanjing.
The joint attack against the Liao had been planned for 1121, but it was rescheduled for 1122. On February 23 of that year, Jin captured the Liao Central Capital as promised. The Song delayed their entry into the war because it diverted resources to fighting the Western Xia in the northwest and suppressing a large popular rebellion led by Fang La in the south. When a Song army under Tong Guan's command finally attacked Yanjing in May 1122, the smaller forces of the weakened Liao repelled the invaders with ease. Another attack failed in the fall. Both times, Tong was forced to retreat back to Kaifeng. After the first attack, Aguda changed the terms of the agreement and only promised Yanjing and six other prefectures to the Song. In early 1123 it was Jurchen forces that easily took the Liao Southern Capital. They sacked it and enslaved its population.
The quick collapse of the Liao led to more negotiations between the Song and Jin. Jurchen military success and their effective control over the Sixteen Prefectures gave them more leverage. Aguda grew increasingly frustrated as he realized that despite their military failures the Song still intended to seize most of the prefectures. In the spring of 1123 the two sides finally set the terms of the first Song–Jin treaty. Only seven prefectures would be returned to the Song, and the Song would pay an annual indemnity of 300,000 packs of silk and 200,000 taels of silver to the Jin, as well as a one-time payment of one million strings of copper coins to compensate the Jurchens for the tax revenue they would have earned had they not returned the prefectures. In May 1123 Tong Guan and the Song armies entered the looted Yanjing.
War against the Northern Song
Collapse of the Song–Jin alliance
Barely one month after the Song had recovered Yanjing, Zhang Jue, who had served as military governor of the Liao prefecture of Pingzhou about east of Yanjing, killed the main Jin official in that city and turned it over to the Song. The Jurchens defeated his armies a few months later and Zhang took refuge in Yanjing. Even though the Song agreed to execute him in late 1123, this incident put tension between the two states, because the 1123 treaty had explicitly forbidden both sides from harboring defectors. In 1124, Song officials further angered Jin by asking for the cession of nine more border prefectures. The new Jin emperor Taizong, Aguda's brother and successor, hesitated, but warrior princes Wanyan Zonghan and Wanyan Zongwang vehemently refused to give them any more territory. Taizong eventually granted two prefectures, but by then the Jin leaders were ready to attack their southern neighbor.Before they could invade the Song, the Jurchens reached a peace agreement with their western neighbors the Tangut Western Xia in 1124. The following year near the Ordos Desert, they captured Tianzuo, the last emperor of the Liao, putting an end to the Liao dynasty for good. Ready to end their alliance with the Song, the Jurchens began preparations for an invasion.