and sent to his atabeg (guardian) Gumushtigin in Saveh and Aveh, who had him crowned at Ray. Reign Initial challenges and consolidation of power Although Berkyaruq was generally supported by the Nizamiyya, the modern historian Clifford Edmund Bosworth states that "this does not necessarily imply that the Nizamiyya had a collective policy, for none of the sons of Nizam al-Mulk was his father's equal in ability, and opportunism and personal factors seem often to have swayed them". The Nizamiyya were most importantly looking to seek vengeance against Taj al-Mulk, who was believed to have been behind the death of his rival Nizam al-Mulk (which according to modern historian Andrew Peacock, was probably partly true). A battle took place between the two factions in January 1093, resulting in the defeat of Mahmud's supporters and the capture of Taj al-Mulk. Berkyaruq, aware of Taj al-Mulk's bureaucratic prowess, was willing to make him his vizier. Taj al-Mulk had even managed to appease a section of the Nizamiyya through bribery. Still, this was not enough: the Nizamiyya, thirsty for revenge, secured his execution on 12 February. Terken Khatun soon summoned the Seljuk prince Ismail ibn Yaquti to attack Berkyaruq. Although the former had raised an army of Turkoman from Azerbaijan and Arran, he was defeated and executed by Berkyaruq's atabeg Gumush-Tegin. Terken Khatun then tried to reach out to Tutush, but suddenly died in 1094, with her sickly son Mahmud dying a month later. Berkyaruq also had to deal with his uncle Tutush, who invaded the Jazira and western Iran, seizing the city of Ray. He was, however, killed by Berkyaruq's forces near the same city on 25 February 1095. Berkyaruq thus managed to consolidate his authority in western Iran and Iraq, and was also acknowledged as the sultan by al-Mustazhir. During the chaos that ensued, Malik-Shah's brother Arghun Arslan conquered most of Khurasan (except the city of Nishapur), attempting to establish his own principality in the province. Berkyaruq first sent an army under his uncle Bori-Bars ibn Alp-Arslan in 1095 to conquer Khurasan, but the latter was captured and killed. He sent a second army under his half-brother Ahmad Sanjar in 1097, but before anything occurred Arghun Arslan was killed by one of his own ghulams, due to his brutal treatment of his subjects. Berkyaruq appointed Sanjar as the vassal ruler (malik) of Khurasan, giving him his own atabeg (Amir Qumaj) and vizier