He soon entered into the service of Berkyaruq's half-brother Muhammad I Tapar, who appointed him as his vizier. Mu'ayyid al-Mulk made use of his newfound position to exact vengeance on his rivals, which was made easier because Muhammad had yet to reach adulthood (approximately 17 years old at the time). The Nizamiyya (supporters of Nizam al-Mulk) and the prominent families of Isfahan also joined Muhammad, stopping Berkyaruq from entering the city.[5] The rebellion was launched from Muhammad's base at the city of Ganja in Arran, which had been given to him as a iqta' (land grant) by Berkyaruq back in 1093.[6]