 He held administrative and military posts under Caliph Mu'awiya I (), founder of the Umayyad Caliphate, and his own father, Caliph Marwan I ().By the time of Abd al-Malik's accession, Umayyad authority had collapsed across the Caliphate as a result of the Second Muslim Civil War and had been reconstituted in Syria and Egypt during his father's reign.Following a failed invasion of Iraq in 686, Abd al-Malik focused on securing Syria before making further attempts to conquer the greater part of the Caliphate from his principal rival, the Mecca-based caliph Abd Allah ibn al-Zubayr.