Two more sacred sites are located inside the courtyard, Maqam-e-Ibrahim (station of Abraham) and Zamzam well (sacred spring). Maqam-e-Ibrahim is associated with Quranic account of rebuilding of Kaabah by Prophet Ibrahim (A.S) and his son Prophet Ismael (AS). Makkah is also believed to be the place where Prophet Ismael (AS) and his mother Hagirah (RA) were endowed with the sacred water of Zam Zam. To the east and north of courtyard are the hills of Safa and Marwah that pilgrims must walk between seven times as a part of the ritual. Non-Muslims are forbidden from visiting this religious place.
The contemporary structure of the mosque is a product of centuries of development. Kaabah was also a sacred shrine for the Arab polytheists in the pre-Islamic era where worshippers gathered to pray and perform their rituals. On emigration to Madinah, Prophet Muhammad (pbuh) and his companions worshipped toward Jerusalem as Qiblah (direction of the prayer) for a short time before finally conquering Makkah and returning back. He ordered the destruction of idols at the holy Kaabah and cleansed it of Polytheistic association. Masjid-Al-Haram has been constructed and modernized several times over the course of time.