Badr was the son of one of Caliph al-Mutawakkil's freed slaves, whose name is uncertain. He began his career as an equerry under the stable-master of al-Muwaffaq, the virtual regent of the Caliphate during the reign of his brother al-Mu'tamid and father of the caliph al-Mu'tadid. He then became one of a group of the military slaves or pages recruited by Mu'tadid for the campaigns against the Zanj Rebellion, and appears early on as one of the most prominent figures among this group. Like the other ghilman of Mu'tadid, his name is a "pet name" rather than a regular name, meaning "full moon". Likewise, his kunya was Abu'l-Najm, and he had a son called Hilal, "New Moon". During the Zanj war, the ghilman, often with the young Mu'tadid at their head, played the main role in the fighting, providing the Abbasid armies with a professional core, filling leadership positions, and undertaking the most difficult assaults. Badr was one of the most trusted servants of Mu'tadid, and became all-powerful under the latter's patronage. Already on Mu'tadid's succession of his father as regent of the Caliphate in June 891, Badr was named as chief of security of Baghdad. When Mu'tadid succeeded to the throne in October 892, Badr became commander-in-chief of the army. Aside from leading numerous expedition in person as part the Caliph's campaigns of restoration of Abbasid power, he also came to wield enormous political power: he could exercise a veto on all important government decisions, while his daughter married one of Mu'tadid's sons, the future caliph al-Muqtadir. He was a firm friend of Ubayd Allah ibn Sulayman ibn Wahb, the vizier for most of Mu'tadid's reign, whom he was often able to protect from the Caliph's outbursts of anger. Their smooth working relationship was instrumental in negating the friction between the military and the civil bureaucracy that had plagued earlier rulers. As such, he was often eulogized by the court poets alongside the Caliph himself, particularly by Abu Bakr al-Suli. At Baghdad, he was entrusted with the supervision of the reconstruction of the city's Great Mosque, originally established by al-Mansur. He also built a palace for himself in the new palace district on the part of the city east of the Tigris, after which the nearby gate of Bab al-Khassa became known as the Bab Badr. When Ubayd Allah died in 901, his sponsorship was instrumental in securing the succession to the vizierate of Ubayd Allah's son, Qasim, but the latter did not display any gratitude for this. Indeed, Qasim soon started intriguing against the Caliph and his sons, but when he tried to approach Badr to secure the support of the army, he was rebuffed with indignation. Qasim was saved from denunciation and execution by Badr's absence from the capital on campaign, and by Mu'tadid's sudden death in April 902. As Badr still represented a threat, Qasim moved quickly to defame the general to the new caliph, al-Muktafi. His machinations quickly bore fruit, and Badr was forced to flee to Wasit. Qasim then enticed him to return to Baghdad by a guarantee of safe passage, but on 14 August 902 at al-Mada'in, the vizier's agents attacked Badr while he was praying and cut off his head to send to the Caliph. The corpse was left behind, and later recovered by his relatives and sent for burial at Mecca. The murder of Badr was criticized by the poets of the time, and even the Caliph, "who might have been expected to heave a sigh of relief at seeing the head of the once-powerful general", is said to have reproached Qasim for it.