Battle of Qatwan

The Battle of Qatwan was fought in September 1141 between the Qara Khitai (Western Liao dynasty) and the Seljuk Empire and its vassal-state the Kara-Khanid Khanate. The battle ended in a decisive defeat for the Seljuks, signaling the beginning of the end of the Great Seljuk Empire.

Background
The 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.

Battle
Widely varying figures from different sources were given for the Kara-Khitan forces, ranging from 20,000 to 300,000, and 700,000, while the Seljuk forces numbered 100,000. The Kara-Khitans were also said to have been given a reinforcement of 30,000–50,000 Karluk horsemen. While many Muslim sources suggested that the Kara-Khitan forces greatly outnumbered the Seljuks, some contemporary Muslim authors also reported that the battle was fought between forces of equal size.

The battle took place on the Qatwan steppe, north of Samarkand, on 9 September 1141. The Kara-Khitans attacked the Seljuk forces simultaneously, encircled them, and forced the Seljuq center into a wadi called Dargham, about 12 km from Samarkand. Encircled from all directions, the Seljuq army was destroyed and Sanjar barely escaped. Figures of the dead ranged from 11,000 to 100,000. Among those captured at the battle were Seljuq military commanders and Sanjar's wife.

Aftermath
Yelü Dashi spent ninety days in Samarkand, accepting the loyalty of Muslim nobles and appointing Mahmud's brother Ibrahim as the new ruler of Samarkand. However, Yelü did allow the Muslim Burhan family to continue to rule Bukhara. After this battle, Khwarazm became a vassal state of the Kara-Khitan. In 1142, Yelü sent Erbuz to Khwarazm to pillage the province, which forced Atsiz to agree to pay 30,000 dinars annual tribute.

Historical accounts
Accounts of the battle are given in a number of sources, for example in Sadr al-Din al-Husayni's Arabic chronicle of the Seljuks. He wrote that "there was no unanimity" among the emirs of Sanjar, therefore, soon after the start of the battle, Sanjar's troops began to retreat leaving him "with a small number of soldiers." Seeing that the enemy gained advantage in the battle and were close to Sultan's location, Abu'l Fadl advised Sanjar to put an ordinary soldier in his own place, and save himself, which Sanjar did. Abu'l Fadl, however, remained with the soldier who played the role of the Sultan until the end of the battle, and was soon captured. Many emirs perished in the battle; some of those who were captured were executed at once. Turkan-Khatun was released for ransom of 500 thousand dinars, Emir Kumach and his son – for 100 thousand dinars, and Abu'l-Fadl was freed without ransom when Yelü Dashi learned that the sons of the ruler of Segestan had seized their father's possessions. The Kara-Khitan ruler said: “Such a hero should not be executed!”. After the defeat, Sanjar intended to go to Balkh, and his path lay close to the enemy's location, “since it was impossible to go by other roads.” However, Yelü Dashi ordered not to intervene; Al-Husayni attributes the following words to the Kara-Khitan ruler: “To close the path for the one who retreats means to force him into a desperate battle. And one who does not value his life and does not think about the consequences, can win".

Legend
Stories of this battle, told during the Second Crusade, filtered back to the Holy Land, inspiring stories of Prester John.