 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.