 The Jurchens tried to conquer southern China in the <unk> , but they were bogged down by a pro @-@ Song insurgency in the north and a counteroffensive by the Song generals Yue Fei , Han Shizhong , and others . The generals regained some territories but retreated on the orders of the Southern Song emperor , who supported a peaceful resolution to the war . The Treaty of Shaoxing in 1142 settled the boundary between the two empires along the Huai River , but conflicts between the two dynasties continued until the fall of the Jin in 1234 . A campaign against the Song by the fourth Jin emperor , Wanyan Liang ( the Prince of Hailing ) , was unsuccessful . He lost the Battle of Caishi ( 1161 ) and was later assassinated by his own disaffected officers . An invasion of the Jin motivated by Song <unk> ( 1206 – 1208 ) was also unsuccessful . A decade later , the Jin launched an abortive military campaign against the Song in 1217 to compensate for the territory that they had lost to the invading Mongols . The Song formed an alliance with the Mongols in 1233 , and in the following year jointly captured Caizhou , the 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 fell in 1279 . 
