The dynasty was founded by commander Anush Tigin Gharchai, a former Turkish slave of the Seljuq sultans, who was appointed as governor of Khwarezm. His son, Qutb ad-Din Muhammad I, became the first hereditary Shah of Khwarezm, the date of the founding of the Khwarazmian dynasty remains debatable. During a revolt in 1017, Khwarezmian rebels murdered Abul-Abbas Mamun and his wife, Hurra-ji, in response, Mahmud invaded and occupied the region of Khwarezm, which included Nasa and the ribat of Farawa. As a result, Khwarezm became a province of the Ghaznavid Empire from 1017 to 1034, in 1077 the governorship of the province, which since 1042/1043 belonged to the Seljuqs, fell into the hands of Anush Tigin Gharchai, a former Turkic slave of the Seljuq sultan. In 1141, the Seljuq Sultan Ahmed Sanjar was defeated by the Qara Khitai at the battle of Qatwan, Sultan Ahmed Sanjar died in 1156. As the Seljuk state fell into chaos, the Khwarezm-Shahs expanded their territories southward, in 1194, the last Sultan of the Great Seljuq Empire, Toghrul III, was defeated and killed by the Khwarezm ruler Ala ad-Din Tekish, who conquered parts of Khorasan and western Iran. In 1200, Tekish died and was succeeded by his son, Ala ad-Din Muhammad, following the sack of Khwarizm, Muhammad appealed for aid from his suzerain, the Qara Khitai who sent him an army. With this reinforcement, Muhammad won a victory over the Ghorids at Hezarasp, Ala ad-Din Muhammads alliance with his suzerain was short-lived. He again initiated a conflict, this time with the aid of the Kara-Khanids, and defeated a Qara-Khitai army at Talas and he overthrew the Karakhanids and Ghurids. In 1212, he shifted his capital from Gurganj to Samarkand, by 1218, the empire had a population of 5 million people. In 1218, Genghis Khan sent a mission to the state. Genghis Khan demanded reparations, which the Shah refused to pay, Genghis retaliated with a force of 200,000 men, launching a multi-pronged invasion. In February 1220 the Mongolian army crossed the Syr Darya, the Mongols stormed Bukhara, Gurganj and the Khwarezmid capital Samarkand. The Shah fled and died weeks later on an island in the Caspian Sea. The son of Ala ad-Din Muhammad, Jalal ad-Din Mingburnu became the new Sultan and he attempted to flee to India, but the Mongols caught up with him before he got there, and he was defeated at the Battle of Indus. He escaped and sought asylum in the Sultanate of Delhi, iltumish however denied this to him in deference to the relationship with the Abbasid caliphs. Returning to Persia, he gathered an army and re-established a kingdom and he never consolidated his power, however, spending the rest of his days struggling against the Mongols, the Seljuks of Rum, and pretenders to his own throne. He lost his power over Persia in a battle against the Mongols in the Alborz Mountains, escaping to the Caucasus, he captured Azerbaijan in 1225, setting up his capital at Tabriz
Khwarezmid Empire in 1217
Eurasia c. 1200, on the eve of the Mongol invasions.