Malik-Shah suddenly died only a mouth and a few days after the death of Nizam al-Mulk. In the following civil war between Barkiyaruq (the official heir) and Malik-Ismail (supported by Tarkan Khatun), the latter was defeated in a battle near Boroujerd. Taj al-Mulk was arrested, and Barkiyaruq (who was aware of his competency) at first decided to grant him the post of viziership, but he was assassinated by the supporters of Nizam al-Mulk who considered him responsible for the death of Nizam al-Mulk.