Khwarazmian dynasty
Shortly after his ascension, Baha al-Din became famous among his subjects, and patronized many scholars such as the prominent Iranian philosopher Fakhr ad-Din ar-Razi. In 1198, Baha al-Din wrested Balkh from Kara-Khitan control after the death of its governor. During the same year, war broke out between the Ghurids and the Khwarazmian dynasty, which was supported by their suzerain Kara-Khitans; the Khwarazmians attacked Herat, while the Kara-Khitans invaded Guzgan, and demanded tribute from Baha al-Din. However, the Ghurids shortly managed to inflict a heavy defeat on the two empires, and then used the opportunity to conquer Marv, Sarakhs, Nasa, Abiward, Tus, and Nishapur. Several Ghurid princes were shortly appointed as the governor of the cities, which included a nephew of Baha al-Din's grandfather Fakhr al-Din Masud, Taj al-Din Zangi.