Before the rise of Islam the Ka'aba, and Mecca (previously known as Bakkah), were revered as a sacred sanctuary and was a site of pilgrimage. Some identify it with the Biblical "valley of Baca" from Psalms 84 (Hebrew: בָּכָא). At the time of Muhammad (AD 570–632), his tribe the Quraysh was in charge of the Kaaba, which was at that time a shrine containing hundreds of idols representing Arabian tribal gods and other religious figures. Muhammad earned the enmity of his tribe by claiming the shrine for the new religion of Islam that he preached. He wanted the Kaaba to be dedicated to the worship of the one God alone, and all the idols were evicted. The Black Stone (al-Hajar-ul-Aswad), still present at the Kaaba was a special object of veneration at the site. According to tradition the text of seven especially honoured poems were suspended around the Ka'aba. However it is important to note that the Kaba in the first place was built by Prophet Abraham, who was the father of all the Abrahamic religions.
According to Islam, Muhammad's actions were not strictly a conversion but rather a restoration of the mosque established on that site by Abraham, who is considered to be a prophet in Islam. The Ka'aba thus became known as the Masjid al-Haram, or Sacred Mosque, the holiest site in Islam.