	In any case, in the summer of 684, when Marwan was elected caliph by pro-Umayyad loyalist tribes, chief among them the Banu Kalb, Abd al-Aziz was in his father's company. He fought alongside his father and the Banu Kalb against al-Dahhak ibn Qays al-Fihri and the Qaysi tribes, who supported Ibn al-Zubayr, who had declared himself caliph in 683 and gained widespread recognition in the Caliphate, at the Battle of Marj Rahit near Damascus in August. Abd al-Aziz was thrown off his horse during the battle, which ended in a crushing Umayyad–Kalbite victory. Afterward, he played a leading role in Marwan's conquest of Egypt from its Zubayrid governor Ibn Jahdam al-Fihri, serving as the commander of a contingent which crossed into the province through the Sinai Peninsula, via the Red Sea port town of Ayla. There he confronted Ibn Jahdam and his deputy Zuhayr ibn Qays al-Balawi, the latter of whom ultimately defected to Abd al-Aziz. After Marwan returned to Syria, he designated Abd al-Malik as his successor, to be followed by Abd al-Aziz; the former acceded as caliph upon Marwan's death in April 685.