Born in Samarra as a prince of the imperial house and the great-great-grandson of Harun al-Rashid, Ibn al-Mu'tazz had a tragic childhood in the Byzantine intrigues of the Abbasid caliphate. His grandfather, the caliph al-Mutawakkil, was assassinated when Ibn al-Mu'tazz was only six weeks old. These events ushered in the nine-year Anarchy at Samarra. Abdallah ibn al-Mu'tazz's father, al-Mu'tazz 14th Caliph of the Abbasid Caliphate, came to power in 866, but in 869 was also murdered. The boy was spared the purge of the palace by fleeing to Mecca with his grandmother.
Upon returning to Baghdad soon after, he distanced himself from politics and lived the hedonistic life of a young prince. It was during this time that he wrote his poetry, devoted to the pleasures with which he was so familiar.
After reigning from 5 April 902–13 August 908, the 17th Caliph, Abdallah ibn al-Mu'tazz's cousin Al-Muktafi, died. Vizier al-Abbas ibn al-Hasan al-Jarjara'i wished to install Al-Muktafi's thirteen-year-old brother Al-Muqtadir on the throne, clearly intending to be the power behind the throne himself. Despite his reluctance, Ibn al-Mu'tazz was persuaded by the opposition to assume the caliphate instead, in the hope that he would put an end to the intrigues that had plagued the dynasty for decades. He was crowned on 17 December 908, but was overthrown the same day. He fled the palace in Baghdad and hid with a friend, but was found on 29 December and strangled. Almost prophetically, he had once written as a poet:
A wonderful night, but so short
I brought it to life, then strangled it.