The dynasty was founded by commander Anushtegin Gharchai, a former Turkic slave of the Seljuq sultans, who was appointed as governor of Khwarazm.
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 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, who initiated a conflict with the Ghurids and was defeated by them at Amu Darya (1204).
Thus incorporating nearly the whole of Transoxania[citation needed] and present-day Afghanistan into his empire, which after further conquests in western Persia (by 1217) stretched from the Syr Darya to the Zagros Mountains, and from the northern parts of the Hindu Kush to the Caspian Sea.