Medina's importance as a religious site derives from the presence of Al-Masjid al-Nabawi or The Mosque of The Prophet. The tomb of Prophet Muhammad later became part of the mosque when it was expanded by the Umayyad Caliph Al-Walid I. Mount Uhud is a mountain north of Medina which was the site of the second battle between Muslim and Meccan forces.
The first mosque built during Muhammad's time is also located in Medina and is known as Masjid Quba (the Quba Mosque). It was destroyed by lightning, probably about 850 CE, and the graves were almost forgotten. In 892, the place was cleared up, the tombs located and a fine mosque built, which was destroyed by fire in 1257 CE and almost immediately rebuilt. It was restored by Qaitbay, the Egyptian ruler, in 1487.
Masjid al-Qiblatain is another mosque also historically important to Muslims. It is where the prophet changed the direction of prayer (qibla) from Jerusalem to Mecca according to Sunni hadiths.
Like Mecca, the city of Medina only permits Muslims to enter, although the haram (area closed to non-Muslims) of Medina is much smaller than that of Mecca, with the result that many facilities on the outskirts of Medina are open to non-Muslims, whereas in Mecca the area closed to non-Muslims extends well beyond the limits of the built-up area. Both cities' numerous mosques are the destination for large numbers of Muslims on their Hajj (annual pilgrimage). Hundreds of thousands of Muslims come to Medina annually to visit the Tomb of Prophet and to worship at mosques in a unified celebration. Al-Baqi' is a significant cemetery in Medina where several family members of Muhammad, caliphs and scholars are buried, as well as Shias imams.