花剌子模
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.