 He was appointed to the role by his distant cousin, Caliph Mu'awiya I (), founder of the Umayyad Caliphate.Afterward, he returned to Medina, where he operated under his father, who had become governor of the city, as the "kātib" (secretary) of Medina's "dīwān" (bureaucracy).As with the rest of the Umayyads in the Hejaz, Abd al-Malik lacked close ties with Mu'awiya, who ruled from his power base in Damascus in Syria.