 The Jin persisted with their advance into the remaining Song territories south of the Yangtze. They faced an insurgency of Song loyalists in the north, the deaths of some important leaders, and military offensives by Song generals like Yue Fei. The Jurchens created the puppet government of Da Qi to serve as a buffer state between Song and Jin, but Qi failed to defeat the Song. The Jin abolished Qi in 1137. As the Jin gave up on conquering the Southern Song, diplomatic talks for a peace treaty resumed. Signed in 1142, the Treaty of Shaoxing established the boundary between the two states along the Huai River, which runs north of the Yangtze. The treaty forbade the Song from purchasing horses from the Jin, but smuggling continued in the border markets. The relations between the two states were mostly peaceful from 1142 to 1161, the year Wanyan Liang went to war.
