The struggle for power remained vigorous. In spite of this, Tekish sent the Qara Khitai home, while Ay-Aba, Terken Khatun and Soltan Shah mustered forces on a campaign to overthrow Tekish and retrieve Gurganj. The ensuing battle occurred at the town of
Suburni not far from the Khwarazmian heartland on 11 July 1174, whereupon Tekish routed his opponents and captured Ay-Aba, who was subsequently executed. Tekish pursued Soltan-Shah to
Dihistan, where the former killed his own mother and captured the city. In Khorasan, Ay-Aba had been succeeded by his son,
Toghan-Shah, who pledged allegiance to Tekish and denied Soltan-Shah refuge when he was at the gates of Nishapur, forcing him to appeal to the Ghurids, who accepted his request for asylum. It seemed like Tekish had won the war, but he soon reneged on his tribute agreement with the Qara Khitai, so the same Fuma that helped him acquire his throne invaded with the help of Soltan-Shah, but Tekish flooded the
Oxus river and forced them to retreat. Fuma withdrew and left a few thousand cavalry to accompany Soltan-Shah, who went to
Merv, which he captured successfully by 1180. In May 1181, he exacted revenge on Toghan-Shah, defeating his army, looting
Nishapur, and conquering
Tus. Tekish was concerned with affairs on other fronts at the time, namely Transoxiana. In 1181 he assigned one of his sons, Malik-Shah, to govern Jand while he and the
Kipchaks devised a joint campaign to attack the Qara Khitai. Crucially, Tekish cemented ties with the Kipchak khan by marrying his daughter, Terken Khatun, giving him access to Kipchak and
Kangly cavalrymen for future campaigns. Tekish marched on
Bukhara where he defeated a sally by the garrison, prompting their surrender. What happened next is vaguely described by the source, but Tekish was back in Khorasan by 1183, and Bukhara was probably lost to the Qara Khitai again shortly after. == Conquest of Khorasan ==