Battle of Qatwan
Samarkand, UzbekistanThe Khitans were people of the Liao dynasty who moved west from Northern China when the Jin dynasty invaded and destroyed the Liao dynasty in 1125. Liao remnants were led by Yelü Dashi who took the Eastern Karakhanid capital of Balasagun. In 1137, they defeated the Western Karakhanids, a vassal of the Seljuks, at Khujand, and the Karakhanid ruler Mahmud II appealed to his Seljuk overlord Ahmed Sanjar for protection.
In 1141, Sanjar with his army arrived in Samarkand. The Kara-Khitans, who were invited by the Khwarazmians (then also a vassal of the Seljuks) to conquer the lands of the Seljuks, and also responding to an appeal to intervene by the Karluks who were involved in a conflict with the Karakhanids and Seljuks, also arrived. At the Battle of Qatwan, the Seljuqs were decisively defeated, which signalled the beginning of the end of the Great Seljuk Empire.