 On 9 January 1127, the Jurchens ransacked Kaifeng, the capital of the Northern Song dynasty, capturing both Emperor Qinzong and his father, Emperor Huizong, who had abdicated in panic in the face of the Jin invasion.Following the fall of Bianjing, the succeeding Southern Song dynasty continued to fight the Jin dynasty for over a decade, eventually signing the Treaty of Shaoxing in 1141, which called for the cession of all Song territories north of the Huai River to the Jin dynasty and the execution of Song general Yue Fei in return for peace.The peace treaty was formally ratified on 11 October 1142 when a Jin envoy visited the Song court.