On arrival in Isfahan, Taj al-Mulk seized and imprisoned Barkiyaruq on Terken Khatun's orders, but the Nizamiyya mamluks, who hated Terken Khatun because of her enmity to their late master, set Barkiyaruq free and took him to Rey, where the rais of the city, Nizam al-Mulk's son-in-law crowned him.