The Anushtegin dynasty or Anushteginids (English: ænuʃtə'ginid, ), also known as the Khwarazmian dynasty () was a Persianate Sunni Muslim dynasty of Turkic mamluk origin from the Bekdili clan of the Oghuz Turks. The Anushteginid dynasty ruled the Khwarazmian Empire, consisting in large parts of present-day Central Asia, Afghanistan and Iran in the approximate period of 1077 to 1231, first as vassals of the Seljuks and the Qara Khitai (Western Liao), and later as independent rulers, up until the Mongol conquest of the Khwarazmian Empire in the 13th century. The dynasty was founded by commander Anushtegin Gharchai, a former Turkic slave of the Seljuq sultans, who was appointed as governor of Khwarazm. His son, Qutb ad-Din Muhammad I, became the first hereditary Shah of Khwarazm. Anush Tigin may have belonged to either the Begdili tribe of the Oghuz Turks or to Chigil, Khalaj, Qipchaq, Qangly, or Uyghurs. Timeline of the Turkic peoples (500–1300) The date of the founding of the Khwarazmian dynasty remains debatable. During a revolt in 1017, Khwarezmian rebels murdered Abu'l-Abbas Ma'mun and his wife, Hurra-ji, sister of the Ghaznavid sultan Mahmud. 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, and Anush Tigin's grandson Ala ad-Din Atsiz became a vassal to Yelü Dashi of the Qara Khitan. 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.