Alaeddin Muhammad (1200–1220)

Now only one goal remained for Alaeddin Muhammad, and that was the elimination of the Kara-Khitai state. First the outbreak of a revolt in Herat and then the uprising of Kezlik, the governor of Nishapur, delayed the campaign to be undertaken against them. After suppressing these revolts, the Sultan marched on Bukhara in the summer of 1207 and took the city, and afterwards came to an agreement with Sultan Osman against the Kara-Khitai. But this agreement set the Kara-Khitai in motion; they succeeded in defeating Sultan Alaeddin Muhammad and increased their pressure on him. Finally Sultan Alaeddin Muhammad set out on a campaign to Transoxiana, crossed the Syr Darya and inflicted a terrible defeat on the Kara-Khitai near Andijan (September 1210).

At this time, events were taking place on the eastern borders of the Kara-Khitai that could prove dangerous for the future. Küchlük (Güçlük), the chief of the Naimans, who had been driven out of Mongolia by Genghis, had joined the Kara-Khitai and become son-in-law to their ruler, the Gur Khan; later he defeated the Kara-Khitai, took the Gur Khan prisoner and seized the state (1211). On the other hand, when Sultan Osman of the Karakhanids, who had earlier become son-in-law to the Khwarazmshah, again drew close to the Kara-Khitai, Alaeddin Muhammad killed him and put an end to this branch of the Karakhanids, and Transoxiana thus passed definitively into the hands of the Khwarazmshah state.

Although Alaeddin had gained the opportunity to extend his influence and power eastward, he could not achieve much success in the face of Küchlük. In the south of the state, too, the struggle with the Ghurids continued. Finally Alaeddin Muhammad entered Ghazna and afterwards also became master of Firuzkuh, an important city of the Ghurids. Thus the Ghurid lands also came under the obedience of Sultan Alaeddin (1215). Later the regions of Kirman, Sistan and as far as the Sea of Oman were also attached to the Khwarazmshahs.

However, the sultan was not on good terms with the Abbasid Caliph al-Nasir in Baghdad. He had wanted to bring him under his own influence but had not succeeded in this. Finally, declaring that the caliphate belonged to the descendants of Hazrat Ali, he appointed a sayyid named "Ala" al-Tirmidhi as caliph. Later the army he sent against Baghdad suffered heavy losses because of the severity of the winter and turned back. Despite this, he did not have the khutba read in the name of the Abbasid Caliph.

However, in Samarkand, Herat and Khwarazm itself the khutba was being read in the name of the Abbasid Caliph. The greatest factor in this was the sultan's mother, Terken Khatun. The Sultan was engaged in a political struggle for influence with his mother, and this was shaking the internal structure of the state.