of ceremonies, organizing and supervising caliphal audiences, and bringing visitors to the caliph's presence. He was also head of the palace staff, and might sometimes be employed by the caliph as a trusted agent in eliminating certain of the caliph's subjects. With the rise of the Abbasids, the mawālī gained in prestige at court, despite their often very humble origin. With the introduction of the vizier as the head of government, a kind of separation of powers emerged, where the vizier—usually drawn from the secretarial class—headed the administration, while the hajib controlled courtly affairs. The holders of the two offices often vied for control of the administration; thus the hajibs al-Rabi' ibn Yunus and his son al-Fadl ibn al-Rabi' both became viziers after the dismissal of their rivals who previously held the office. This division and the rivalry between the two offices was strengthened during the "Samarra period", when the office of hajib began to be occupied by Turkish slave soldiers (ghilman, sing. ghulam), whose "background, formation, and interests differed starkly from those of the bureaucratic vizier". Under Caliph al-Mutawakkil, the Turkish hijab Itakh served as chief minister, since the Caliph did not nominate a vizier. In the late 9th century, the position of the vizier was strengthened, as the powers of the office became more formalized and he emerged as the head of the civilian administration, underpinned by a highly specialized secretarial class. Another contender for authority also emerged in the commander-in-chief of the army. However, the hajib remained a powerful official, especially during palace coups, as he controlled a part of the caliphal bodyguard, notably the Maṣāffiyya. Under al-Muqtadir (), the hajib Nasr al-Qushuri became a major power-broker, since he occupied his post continuously from 908–929, whereas the viziers changed rapidly during this period. He not only had a role in the selection of several viziers, but also was responsible for arresting them when they were dismissed. After 929, the commanders-in-chief supplanted the viziers in power and began dominating the government, becoming the main rivals of the hajib, who now also assumed a more military character. Thus the hajib Yaqut had his son Muhammad ibn Yaqut appointed sahib al-shurta in his rivalry with the commander-in-chief Mu'nis al-Muzaffar, before they were both dismissed at the latter's insistence. Under al-Qahir () the hajib Ibn Yalbaq was a soldier who tried to impose his pro-Shi'a beliefs on the caliph. Under ar-Radi,