After the destruction of the Seljuks, the Khwarazmians conquered all of
Persian Iraq including Hamadan, Ray, Isfahan, Saveh, Qom, among others by 25 June, 1194. Isfahan was assigned to Qutlugh-Inanch, Hamadan to Amir Qaragoz, and Ray to Yunus-Khan with an assigned Atabeg named
Mayachuq. Initially, relations with al-Nasir were quite warm. He issued a
manshur granting all of Persian Iraq as an
iqta and sent various gifts to the Khwarazmshahid court, but he indicated an intention to expand his territories there. So, he sent a vizier,
Ibn al-Qassab with an army of 10,000 Kurdish and Bedouin troops, who provided Tekish with royal garments and a deed assigning the land to him after meeting at the
Asadabad Pass. al-Qassab then requested Tekish meet him at his horse in person with a small escort, but Tekish saw through this as an obvious trap and attacked his camp, defeating the Caliphal army. The Arabs were chased as far as
Dinavar and their camp looted, and Tekish pressed demands that the Sultan's Palace be rebuilt in Baghdad and Khwarazmian suzerainty over the Caliph be acknowledged in a similar way to that of the
Buyids or Seljuks. Ibn al-Qassab did not relent and regrouped at the Hulwan Pass, while Tekish returned to Khwarazm in 1195, delegating the defense of Persian Iraq to the brother of incumbent Eldiguzid atabeg,
Uzbek ibn Muhammad. The Caliph's army did not stand idly as this happened. Qutlugh Inanch first defected to them, but Mayachuq defeated him near Zanjan and he fled to Hulwan where Ibn al-Qassam was. The two crossed the Zagros and attacked Hamadan via Kermanshah, capturing it and defeating a Khwarazmian force led by Mayachuq and Yunus-Khan. They advanced as far as Ray, which they captured, with the last troops of Tekish fleeing and dispersing to Damghan, Bistam, and Jurjan. Throughout Persian Iraq, arab tribal forces began pillaging and massacring locals, while the Eldiguzid mamluk,
Izz' ad-Din Gokcha captured Ray, Qom, Saveh and Kashan for himself, and his gains were recognized by al-Nasir in a
manshur. In late 1195, Isfahan and the rest of Persian Iraq fell to the Caliph under a commander named
Sayf ad-Din Toghrul. However, Qutlugh Inanch, who hadn't received any land and realized the cynical motivations of the Arabs, revolted and sacked Ray with his army, before suffering a defeat to Ibn al-Qassab near Karaj and being forced into hiding. Tekish could only watch from Khwarazm, waiting for an opportunity to strike back. Ibn al-Qassab died in July 1196, so Tekish and Mayachuq immediately marched to Persian Iraq alongside Uzbek ibn Muhammad, decisively defeating the Caliphate on July 15 near Hamadan, which surrendered on 18 July. Ibn al-Qassab's newly buried body was exhumed and then burned. All of Persian Iraq was soon re-occupied, and the marauding Arab contingents were executed at every opportunity. Gokcha was allowed to retain his territories as an Eldiguzid subject, while the rest of the territory was given to Uzbek ibn Muhammad, Yunus-Khan and Mayachuq to jointly govern. Yunus-Khan's wife and daughter of Toghrul III then deceived Qutlugh-Inanch by baiting him into a "peace talk" ruse and having him ambushed and killed. == Wars with Ghurids & Qara Khitai ==