Al-Qaim (sometimes also spelled Ka'im) was born in Salamya in Syria in 895 with the name Abd ar-Rahman. After his father Ubayd Allah al-Mahdi Billah (910-934) seized power in Ifriqiya he was named heir to the throne in 912, and helped put down several revolts. But campaigns into Egypt failed because of the resistance of the Abbasids (914-915 and 919-921).