▁senior ▁offices ▁of ▁the ▁state , ▁alongside ▁the ▁viz ier . ▁From ▁the ▁C ali ph ates , ▁the ▁post ▁spread ▁to ▁other ▁areas ▁under ▁Muslim ▁domin ion : ▁in ▁al - And alus ▁the ▁ha j ib ▁was ▁always ▁superior ▁to ▁the ▁viz ier ▁and ▁by ▁the ▁ 1 0 th ▁century ▁had ▁come ▁to ▁w ield ▁enorm ous ▁power ; ▁in ▁the ▁eastern ▁dynast ies , ▁the ▁Sam an ids , ▁Bu y ids ▁and ▁Gh az nav ids , ▁the ▁title ▁acquired ▁a ▁mainly ▁military ▁role ; ▁under ▁the ▁Sel ju ks , ▁Il k han ids ▁and ▁Tim ur ids ▁it ▁revert ed ▁to ▁its ▁role ▁as ▁a ▁court ▁official ; ▁in ▁F at im id ▁Egypt , ▁the ▁chief ▁ha j ib , ▁sty led ▁Sah ib ▁al - b ab ▁(" Master ▁of ▁the ▁Gate ") ▁or ▁ha j ib ▁al - hu j j ab ▁(" ch am ber lain ▁of ▁chamber la ins , ▁head ▁chamber lain ") ▁was ▁also ▁an ▁important ▁official ; ▁under ▁the ▁Mam lu ks , ▁they ▁acquired ▁important ▁jud icial ▁duties . ▁ ▁Origin ▁The ▁office ▁has ▁its ▁orig ins ▁in ▁pre - I sl am ic ▁Arab ia , ▁where ▁door keep ing ▁( ḥ ij ā ba , ▁" con ce aling ") ▁was ▁one ▁of ▁the ▁duties ▁of ▁domestic ▁slaves ▁or ▁clients ▁( ma w ā l ī , ▁singular ▁ma w l ā ) ▁of ▁an ▁Arab ▁household . ▁Modern ▁sch ol ars ▁have ▁tradition ally