Buyid dynasty
Shortly before his birth, in December 945, Baghdad and the rest of Iraq had been taken over by the Buyid dynasty. Although the Buyids were pro-Shi'a, they had retained the Abbasid caliphate for reasons of legitimacy. The Buyids ruled Iraq ostensibly as caliphal commander-in-chiefs (), but in practice they had reduced the Abbasid caliphs to puppet rulers, confined to their palaces.