During the reign of his cousin Uthman (), Marwan took part in a military campaign against the Byzantines of the Exarchate of Africa (in central North Africa), where he acquired significant war spoils. He also served as Uthman's governor in Fars (southwestern Iran) before becoming the caliph's "katib" (secretary or scribe). He was wounded fighting the rebel siege of Uthman's house, in which the caliph was slain. In the ensuing hostilities between Ali () and the largely Qurayshi partisans of A'isha, Marwan sided with the latter at the Battle of the Camel. Marwan later served as governor of Medina under his distant kinsman Caliph Mu'awiya I (), founder of the Umayyad Caliphate. During the reign of Mu'awiya's son and successor Yazid I (), Marwan organized the defense of the Umayyad realm in the Hejaz (western Arabia) against the local opposition. After Yazid died in November 683, the Mecca-based rebel Abd Allah ibn al-Zubayr declared himself caliph and expelled Marwan, who took refuge in Syria, the center of Umayyad rule. With the death of the last Sufyanid caliph Mu'awiya II in 684, Marwan, encouraged by the ex-governor of Lower Mesopotamia Ubayd Allah ibn Ziyad, volunteered his candidacy for the caliphate during a summit of pro-Umayyad tribes in Jabiya. The tribal nobility, led by Ibn Bahdal of the Banu Kalb, elected Marwan and together they defeated the pro-Zubayrid Qays tribes at the Battle of Marj Rahit in August of that year.