Ma'mun II

Mahmud viewed Khwarazm as a strategically important province, as it would allow him to widen the front against his biggest enemy, the Karakhanids of Transoxiana.

When the caliph al-Qadir sent Ma'mun several awards, including an investiture patent for Khwarazm (confirming him as independent ruler) in 1014, Ma'mun refused to accept the awards in his capital, fearing that personally accepting the symbols of independence would anger Mahmud.

[3] Despite these efforts to placate Mahmud, the Ghaznavid demanded that Ma'mun put his name in the khutba, in effect acknowledging his suzerainty.

The rebels placed his nephew Muhammad on the throne, but Mahmud used the death of his brother-in-law as a pretext for annexing Khwarazm.

[4] During Ma'mun's reign several scholars, such as al-Biruni, resided in Khwarazm, and in fact one of Mahmud's demands upon the shah was that several of them be sent to him.