A Tungusic people, the Jurchen, ancestors of the Manchu, formed an alliance with the Song and reduced the Liao dynasty to vassal status in a seven-year war (1115-1122). The Jurchen leader proclaimed himself the founder of a new era, the Jurchen Jin dynasty. Scarcely pausing in their conquests, the Tungusic Jurchen subdued neighboring Koryo (Korea) in 1226 and invaded the territory of their former allies, the Song, to precipitate a series of wars with China that continued through the remainder of the century. Meanwhile, the defeated Khitan Liao ruler had fled with the small remnant of his army to the Tarim Basin, where he allied himself with the Uyghurs and established the Qara Khitai state (known also as the Western Liao dynasty, 1124-1234), which soon controlled both sides of the Pamir Mountains. The Jurchen turned their attention to the Mongols who, in 1139 and in 1147, warded them off.