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 Jurchens 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.
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 Yue Fei, Han Shizhong, and others. 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 (1142) set the boundary of the two empires along the Huai River, but conflicts between the two dynasties continued until the fall of the Jin in 1234.
A war against the Song begun by 4th Jin emperor, Wanyan Liang, was unsuccessful. He lost the Battle of Caishi (1161) and was later assassinated by his own disaffected officers. An invasion of Jin territory motivated by Song revanchism (1206–1208) was also unsuccessful. A decade later, the 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, last refuge of the Jin emperor. The Jin dynasty collapsed that year in 1234. After the demise of the Jin, the Song dynasty itself 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 battles fought with rudimentary gunpowder bombs like the 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. The 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 the Jin diminished the regional stature of the Song dynasty. The Southern Song, however, quickly returned to economic prosperity, and trade with the Jin was lucrative despite decades of warfare. Lin'an, the Southern Song capital, expanded into a major city for commerce.
The Song and Jin were allies against the Khitan Liao. Painting of Khitan hunters, from the National Palace Museum
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 (907–1125), 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 ChineseSong Empire (960–1276). 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 (1068–1123) united the disparate Jurchen tribes and led a revolt against the Liao. In 1115 he named himself emperor of the Jin "golden" dynasty (1115–1234). Informed by a Liao defector of the success of the Jurchen uprising, the Song emperor Huizong (r. 1100–1127) and his highest military commander the eunuchTong 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 TurkLater 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.
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, the 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 (modern day Beijing).
The joint attack against the Liao had been planned for 1121, but it was rescheduled for 1122. In February 23 of that year, the 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 the 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 (including Yanjing) 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.