The Yanyun negotiations between the Song and Jin dynasties took place during the turbulent period of political corruption and frequent peasant uprisings in the late Northern Song Dynasty. At that time, the ruling group of Song Huizong, Cai Jing, Tong Guan and others intended to take advantage of the decline of the Liao Dynasty to adopt the strategy of destroying the Liao Dynasty by linking Jin and seizing the sixteen states of Yan and Yun ceded by the Liao Dynasty to the Later Jin Dynasty, in order to seek to establish a meritorious cause for all generations. In the first year of Zhenghe (1111), Zheng Yunzhong and Tong Guan were sent to the Liao State, and the Liao people Ma Zhi visited Tong Guan at night and proposed a package of strategies to destroy Liao, which was highly valued by Tong Guan. Subsequently, Ma Zhi returned to Kaifeng, the capital of the Song Dynasty, and suggested to Huizong that he send envoys from Dengzhou and Laizhou to Liaodong to form an alliance with the Jurchens to jointly destroy the Liao Dynasty and seize the Yan and Yun regions ceded to the Liao Dynasty. Huizong praised this and gave Ma Zhi the name Li Liangsi, and later the surname Zhao. After the establishment of the Jin Dynasty, the Song tried to send envoys across the sea, but failed to land. In the first year of Chonghe (the second year of Jin Tianfu, 1118), Ma's political envoy Jin verbally expressed the willingness of Song and Jin to jointly attack Liao, Yan and Yun regions, and Jin dismissed Shen and others to make Song discuss the alliance.
In the second year of Xuanhe (the fourth year of Jin Tianfu, 1120), the Song sent Zhao Liangsi and Ma Zheng to the Jin State, and the Jin also sent envoys to the Song Dynasty many times, and the two sides discussed the attack on the Liao Dynasty, the Song army captured Liao Yanjing, and the Jin army attacked Liaozhong Jing Dadingfu and other places, after the fall of the Liao Dynasty, the Yanyun region belonged to the Song Dynasty, and the Song Dynasty transferred the annual coins originally paid to the Liao Dynasty to the Jin Dynasty, known as the "sea" alliance in history. However, due to the corruption and lack of combat effectiveness of the Song army, hundreds of thousands of troops attacked Liao Nanjing (Yanjing) twice, both of which were defeated by the Liao defenders, and Liao Nanjing was eventually captured by the Jin army. Every year, the Song Dynasty also had to pay an additional 1 million yuan in lieu of taxes, and at the same time delivered the annual "New Year's coin" to the Jin Dynasty. In April of the fifth year of Xuanhe, the Jin side returned Yanjing and the six prefectures to which it belonged to the Song Dynasty. However, most of the Yanjing residents had been captured by the Jin State and sent to the northeast as slaves, and all the Song had gained was a dilapidated empty city, "the city of Qiu Ruins, the Fox's Den", and the Song Dynasty set up the Yanshan Mansion Road to govern the newly acquired Yanjing area. As for the Yunzhou (Liaoxijing) region, Jin Taizu was also returned to the Song Dynasty on the condition that the Song Dynasty offered military expenses. The Jin State had promised to return Shuo, Wu, and Wei to the Song Dynasty first, but the execution was suspended after Jin Taizu's death in June of the same year.
Jin Taizong also kept the covenant after he ascended the throne, but in the second year of Tianhui (the sixth year of Song Xuanhe, 1124), the main generals Zong Han and Zong Wang opposed the cession of Shanxi and Song, and Taizong said: "This is against the order of the first emperor and must be carried out immediately." "Zong Han and Zong Wang of the Jin Dynasty were firmly opposed to the cession of Shanxi. According to the "Jin Shi Zong Han Biography", Zong Han once again played the emperor and said: "At the beginning of the first emperor's conquest of Liao, we joined forces with the Song Dynasty to attack, so we agreed to cede Yan Land. However, since the Song side had signed an alliance with us and asked for additional rewards in exchange for the Shanxi states, the first emperor rejected their request. The covenant clearly stipulates that it is not tolerated to harbor fugitives, nor to lure border people. Now, however, the Song Dynasty appeased the defectors in many ways and rewarded them generously. We repeatedly reported the names of the defectors, demanded the surrender of Tong Guan, agreed on a time and an oath, but to no avail. How can we expect the covenant to last long before the time limit has expired, but now that it has already happened?In addition, the western part has not yet been stabilized, and if the counties of Shanxi are ceded, then the armies will lose their strongholds, and it is likely that it will be difficult to hold on for a long time. Therefore, please do not cede for a while. The emperor did exactly as he was requested.
Therefore, the Song Dynasty also knew that their request to Shanxi was not a violation of the covenant, so they asked for an increased reward. Jin Taejo did not accept the Song Dynasty's reward, but agreed alone, which was in effect ceding the legally occupied former Liao land to the Song Dynasty for the purpose of reconciliation, on the condition that "no fugitives should be allowed to be hidden, nor should border people be lured". Zong Han believed that the Song Dynasty had violated the conditions of the covenant and was a breach of the contract, so he opposed the re-cession of Shanxi towns to the Song Dynasty, and at the same time, he proceeded from consolidating the situation in the western part of the Jin Dynasty. The Jin army invaded the Song realm. In May of the fifth year of Song Xuanhe, Zhang Jue, the Liao general of the Jin army, Jin Nanjing (Pingzhou) stayed behind, rebelled against the Jin Dynasty in Pingzhou (now Lulong, Hebei), in early June, Zhang Jue was defeated and fled to Yanshan Mansion, was taken in by the Song Dynasty, recruited defectors and broke the Song-Jin covenant, "dishonesty in Jin, will inevitably attract foreign trouble", although Song then executed Zhang Jue and sent his head to the Jin Dynasty, but it still became an excuse for Jin Taizong to invade the Song Dynasty. In March of the seventh year of Xuanhe (the third year of Jin Tianhui, 1125), the Jin army captured Emperor Tianzuo of Liao and eliminated the remaining Liao forces except for Yelu Dashi, who moved westward.
Zong Han of the Jin Dynasty reported that "Song Duolu appeased the defectors", "Hulu reported that the Song Dynasty would not pay the annual currency account and would change the covenant", "Zong Han and Zong Wang both suggested attacking the Song Dynasty", and Jin Taizong issued an edict to attack the Song Dynasty in October of the same year. The Jin army fought on two routes, with the western route led by Deputy Marshal Zong Han (Sticky Han) attacking Taiyuan (present-day Shanxi) from Datong Mansion (Yunzhou) in Xijing to the south. The eastern route of Nanjing Road is Zongwang (斡立不), and the six roads are all tart lazy as the main generals, and attack Yanshan from Nanjing (Pingzhou) to the west. In November, the Jin army of the Eastern Route occupied Danzhou (present-day Miyun, Beijing) and Jizhou (present-day Jinji County). At the beginning of December, Zong Han, the commander of the Jin Army on the Western Road, sent an envoy to Taiyuan and demanded that Tong Guan "immediately cede the land on the Hedong and Hebei roads, take the Great River as the boundary, and retain the Zongmiao Sheji of the Great Song Dynasty." Tong Guan immediately fled to Kaifeng. The Jin army advanced south in two directions, and Zong Han led all the way to conquer Shuozhou, Daizhou and Xinzhou, and finally besieged Taiyuan. At the same time, another Jin army marched east to Sanhe and defeated the Song army at Baihe and Gubeikou in the east of Yanshan Prefecture, causing Guo Yaoshi's forces to surrender.
As the news of the Jin army's siege of Taiyuan reached Kaifeng, Emperor Huizong issued an edict abolishing the Huashigang and Yanfu Palace in Zhulu, Zhejiang, stopping the business activities of the Xicheng Rental School and the Internal and External Manufacturing Bureau, and abolishing the positions of Daoguan, Dasheng Mansion and Xingxing Bureau. Faced with the threat of the Jin State moving southward, Huizong only wanted to escape, and hurriedly appointed the crown prince Zhao Huan as the pastor of Kaifeng, and ordered the Qin kings to raise troops in various places, trying to shirk the responsibility of resisting Jin in the name of the prince's "prison of the country". Under the almost persecution of Wu Min, Li Gang and others, Huizong passed the throne to the crown prince in late December of that year and became Song Qinzong. The Jin army on the eastern route failed to capture Zhongshan and Zhending, so they crossed the city and advanced south. After Qinzong ascended the throne, the Jin army of the Eastern Road successively captured Qingyuan Mansion and Sindh Mansion. At the beginning of the first month of the first year of Jingkang, the Jin army of the East Road occupied Xiangzhou and Junzhou, and the defenders on the south bank of the Yellow River broke and fled and burned the river bridge. After the news reached Kaifeng, Huizong fled in the middle of the night that day. The Jin army of the East Road then crossed the river and advanced southward, and arrived at the city of Kaifeng on the seventh day of the first month. Under the leadership of Li Gang, the ruling and Tokyo-left defender, the Kaifeng army and civilians successfully repelled many attacks by the Jin army. However, the Jin envoys demanded that the Song Dynasty cede the three towns of Taiyuan, Zhongshan and Hejian, and that the Song Dynasty send the prime minister and prince as pledges before they were willing to withdraw their troops.
Qinzong decided to send King Kang Zhao Gou and Shaozai Zhang Bangchang to negotiate with the Jin army. However, after the failure of the Song army's night attack on the Jin army, which was personally presided over by Song Qinzong, he relieved Li Gang of his post as a sign of sincerity, and finally agreed to cede Sanfu City. Some students and tens of thousands of residents rose up against it and demanded that Li Gang be reinstated to lead the anti-Kim struggle. After Qinzong had no choice but to restore Li Gang to his ruling position and lead the defense of the capital, he still insisted on carrying out the activities of ceding land and seeking peace. With the continuous reinforcement of the Qin Wang's army in the Song Dynasty, the Jin army on the western route was stranded in Hedong because it failed to conquer Taiyuan. Eventually, on the condition that the Song dynasty agreed to cede the three towns and replace Zhao Shu with Zhao Gou and Zhang Bangchang as hostages, the Jin army of the Eastern Route withdrew from Kaifeng on 9 February. The Jin army attacked Taiyuan for a long time, leaving a part of the troops outside the city, and the main force turned south, successively captured the Weisheng army and Longde Mansion, and finally reached Zezhou, but after encountering the Song envoy who went north, he was forced to return north. After Huizong fled to Zhenjiang, he relied on the decree of Emperor Taishang to seize the military, political, and economic power in the southeastern region, and tried to regain the throne as emperor.
In order to maintain the throne, Qinzong degraded the "six thieves" such as Wang Hao, Li Yan, and Zhu Mian, and executed them, and then degraded Tong Guan, Cai You, and Cai Jing, who fled south, and issued an edict prohibiting Emperor Song Huizong from interfering in political affairs. Huizong was forced to express his willingness to return to Kaifeng through a secret letter, but not to return to the throne, but his actions were restricted. Cai Jing died on the way to the debasement, and Cai You, Tong Guan, and Zhu Mian were executed one after another. Although Song Qinzong issued an edict to cede the three prefectures in order to seek peace, the military and civilians of Taiyuan, Hejian, and Zhongshan did not accept the edict of ceding land. Zong Han, the commander of the Jin army on the western route, left part of his troops to continue to attack Taiyuan, and he retreated to Datong. The Jin army of the Eastern Road temporarily retreated to Yanjing under the leadership of the Song generals. Under the situation of Li Gang and others insisting on resisting Jin, and the military and civilians of the three prefectures resisting the cession of land, Song Qinzong abolished the agreement on land cession and peace in mid-February. The middle of the seed division went west to reinforce Taiyuan, and encountered the Jin army in Yuci, and fought a fierce battle for nearly half a day, and the Song army was hungry and finally defeated. In early August, Jin Taizong ordered Zong Wang and Zong Han to lead the Eastern and Western Route armies to carry out a second invasion of the Song Dynasty. After Taiyuan was broken by the Jin army, Wang Yu led his army to engage in street battles, and finally committed suicide in defeat.
At the beginning of October, Zhending Mansion was captured, and the Song general Liu Yi committed suicide after being defeated in a street battle, and Zhang Miao, the Taishou guard, was killed after being captured. The Jin army of the two routes attacked the city and seized the land and quickly moved south, and Song Qinzong once again sent an envoy to agree to cede the three provinces. The Jin State crossed the river again and went south, putting forward the condition of demarcating the river as the boundary, and Song Qinzong immediately sent the consuls Geng Nanzhong and Nie Chang to hold talks with Zong Wang and Zong Han, the commanders of the Jin army on the two routes, respectively. At the same time, Zhao Gou and Wang Yun arrived in Cizhou, but Wang Yun was killed by local residents upon arrival, and then Zhao Gou hurriedly withdrew to Xiangzhou, while Geng Nanzhong went to Weizhou with the Jin envoy, but was attacked by local villagers, and the Jin envoy escaped, while Geng Nanzhong went to Xiangzhou to find Zhao Gou, and the two agreed to unite to defend against the Jin army. At the same time, Nie Chang arrived in Jiangzhou but was attacked by the defenders and failed to complete the mission of ceding land and negotiating peace. The two Jin armies arrived at Kaifeng from the end of November to the beginning of leap November, and launched several sieges of the city, all of which were met with stubborn resistance from the Kaifeng army and people. However, Song Qinzong and Youxiang surprisingly believed in Guo Jing's so-called "Liujia Divine Soldiers" and listened to his instructions to attack the Jin army. Guo Jing claimed that the divine soldiers were in battle, which led to the opening of the city gates, and the Jin army took the opportunity to capture the Kaifeng city wall.
Subsequently, Song Qinzong presented a surrender table on the 2nd day of the first month of December, and the Jin army ordered the abolition of Emperor Huizong of Song and Emperor Qinzong on February 6, the second year of Song Jingkang (the fifth year of Jin Tianhui). Zong Wang and Zong Han escorted the two emperors of Huizong and Qinzong and their clans more than 470 people to the north. Jin Taizong had decided to destroy the Song Dynasty, and he set up a puppet regime to rule the former Song ruled south of the Yellow River. After the abolition of Huizong and Qinzong of the Song Dynasty, the Jin State issued an edict to canonize Zhang Bangchang as the emperor of the Chu State, ascended the throne in Kaifeng, and designated the capital as Jinling (present-day Nanjing, Jiangsu). Zhang Bangchang was originally a native of Song Dongguang (now Hebei), served as a ruler in the Song court, and was later promoted to Shaozai (second minister), advocated the cession of land for peace, and successively served as a hostage of Zhao Gou, the king of Kang, and Zhao Shu, the king of Su, and was later promoted to Dazai (prime minister). After canonizing Zhang Bangchang as the puppet emperor of Chu, the Jin state withdrew its troops in early April. Zhang Bangchang was forced by the situation to welcome the abolition of the Meng family as the Empress Dowager of the Song Dynasty, and he served as the left servant of Shangshu. However, the puppet Chu regime set up by the Jin State actually lasted only 32 days before it perished on its own.