Al-Masjid an-Nabawi (Arabic: المسجد النبوي, lit. ‘The Prophetic Mosque’), known in English as the Prophet’s Mosque, is a mosque built by the Islamic prophet Muhammad in the city of Medina in the Al Madinah Province of Saudi Arabia. It was the second mosque built by Muhammad in Medina, after Quba Mosque, and is the second largest mosque and second holiest site in Islam, both titles ranking after the Masjid al-Haram in Mecca.The mosque is located at the heart of Medina and is a major pilgrimage site that falls under the purview of the Custodian of the Two Holy Mosques.
Muhammad was involved in the construction of the mosque. At the time, the land of Al-Masjid an-Nabawi belonged to two young orphans, Sahl and Suhayl, and when they learned that Muhammad wished to acquire their land to erect a mosque, they went to Muhammad and offered the land to him as a gift; Muhammad insisted on paying a price for the land because they were orphaned children.
The price agreed upon was paid by Abu Ayyub al-Ansari, who thus became the endower or donor (Arabic: واقِف, romanized: waqif) of Al-Masjid an-Nabawi on behalf of, or in favor of, Muhammad, al-Ansari also accommodated Muhammad upon his arrival at Medina in 622.