Why was the Dome built?
Whatever the history of the rock, the Muslims built over
that outcropping an extraordinary octagonal shrine. According to the
inscription preserved within, this shrine was the work of Caliph Abd al-Malik and
was completed in AD 692. We have, moreover, an explanation of the caliph's
motives offered about AD 874 by the historian Ya'qubi. Abd al-Malik was faced
by a serious challenge to his power by the rebel Ibn al-Zubayr, who then
controlled Mecca:
Then Abd al-Malik forbade the people of Syria to make the pilgrimage [to Mecca], and this by reason that Abdullah ibn Zubayr was wont to seize on them during the time of the pilgrimage and force them to pay him allegiance-- which, Abd al-Malik having knowledge of, forbade the people to journey forth to Mecca. But the people murmured thereat, saying "How do you forbid us to make the pilgrimage to God's house, seeing that the same is a commandment of God upon us?" But the caliph answered them, "Has not Ibn Shihab al-Zuhri [the traditionalist who knew many of the Companions of the Prophet] told you how the Apostle of God did say 'Men shall journey to but three mosques, the Holy Shrine (at Mecca), my mosque (at Medina), and the mosque of the Holy City (of Jerusalem)'? So this last is now appointed to you (as a place of worship) in place of the Holy Shrine of Mecca. And this Rock, of which it is reported that the Apostle of God set his foot when he ascended into heaven, shall be to you in the place of the Ka'ba." Then Abd al-Malik built above the rock a dome and hung it around with curtains of brocade, and he instituted doorkeepers for the same, and the people took up the custom of circumambulating the rock, even as they had paced around the Ka'ba, and the usage continued thus all the remaining days of the dynasty of the Umayyads [from AD 692 to 750]. (Le Strange 1890: 116)
From F.E. Peters, Jerusalem. p 197