Hajib or hadjib (Arabic: الحاجب, romanized: al-ḥājib, [æl ˈħæːdʒib]) was a court official, equivalent to a chamberlain, in the early Muslim world, which evolved to fulfil various functions, often serving as chief ministers or enjoying dictatorial powers. The post appeared under the Umayyad Caliphate, but gained in influence and prestige in the more settled court of the Abbasids, under whom it ranked as one of the senior offices of the state, alongside the vizier. From the early caliphates, the post spread to other areas under Muslim dominion: in al-Andalus the hajib was always superior to the vizier and by the 10th century had come to wield enormous power as a de facto chancellor; in the eastern dynasties, the Samanids, Buyids and Ghaznavids, the title acquired a mainly military role; under the Seljuks, Ilkhanids and Timurids it reverted to its role as a court official; in Fatimid Egypt, the chief hajib, styled sahib al-bab ('Master of the Gate') or hajib al-hujjab ('chamberlain of chamberlains, head chamberlain') was also an important official; under the Mamluks, they acquired important judicial duties.