 Al-Hakam was known to have staunchly opposed the Islamic prophet Muhammad and was thus exiled by the latter from Mecca to the nearby town of Taif.According to the history of 9th-century historian al-Tabari, Muhammad later pardoned al-Hakam and he was allowed to return to his hometown.However, in the history of 9th-century historian al-Yaqubi, al-Hakam was allowed to return to Mecca by his nephew, Caliph Uthman ibn Affan (r. 644–656), after his petitions to return were rejected by the previous two caliphs, Abu Bakr (r. 632–634) and Umar (r. 634–644).