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 eunuch Tong Guan saw the Liao weakness as an opportunity to recover the Sixteen Prefectures , a line of fortified cities and pass that the Liao had annexed from the Shatuo Turk Later 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 .