Abd al-Malik ibn Marwan ibn al-Hakam (July/August 644 or June/July 647 – 9 October 705), was the fifth Umayyad caliph, ruling from April 685 until his death in October 705. A member of the first generation of born Muslims, his early life in Medina was occupied with religious pursuits. He held administrative and military posts under Caliph Mu'awiya I (r. 661–680), founder of the Umayyad Caliphate, and his own father, Caliph Marwan I (r. 684–685). By the time of Abd al-Malik's accession, Umayyad authority had collapsed across the Caliphate as a result of the Second Fitna 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. To that end, he concluded an unfavorable truce with the reinvigorated Byzantine Empire in 689, quashed a coup attempt in Damascus by his kinsman, al-Ashdaq, the following year, and reincorporated into the army the rebellious Qaysi tribes of the Jazira (Upper Mesopotamia) in 691. He then conquered Zubayrid Iraq and dispatched his general, al-Hajjaj ibn Yusuf, to Mecca where he killed Ibn al-Zubayr in late 692, thereby reuniting the Caliphate under Abd al-Malik's rule. The war with Byzantium resumed, resulting in Umayyad advances into Anatolia and Armenia, the destruction of Carthage and the recapture of Kairouan, the launchpad for the later conquests of western North Africa and the Iberian Peninsula, in 698. In the east, al-Hajjaj had become Abd al-Malik's viceroy and firmly established the caliph's authority in Iraq and Khurasan, stamping out opposition by the Kharijites and the Arab tribal nobility by 702. Abd al-Malik's final years were marked by a domestically peaceful and prosperous consolidation of power.