It is not permissible to
build a Masjid over graves or exhume the dead to raise a Masjid in their places. The graves have a greater right to the site where they were built, and Muslims must look for another place to build the Masjid. Similarly, it is not permissible to install pillars in the graves or build over them, whether the building is a Masjid or whatsoever. Masjids are not to be built over graves, and the dead must not be disturbed. Furthermore, performing prayers in such Masjids leads people to associate its dwellers as partners with Allah and exaggerate their status. Therefore, it was authentically reported from Allah's Messenger (peace be upon him) that he stated:
May Allah curse the Jews and the Christians, for they have taken the graves of their Prophets as places of worship.
(Agreed upon by Al-Bukhari and Muslim) It was also related by
Muslim in his Sahih (authentic) Book of Hadith on the authority of
Jabir ibn `Abdullah (may Allah be pleased with both of them):
The Messenger of Allah (peace be upon him) forbade plastering of the graves, sitting on them and building over them.
Muslim, the Prophet (peace be upon him) said,
Beware of those who preceded you and used to take the graves of their prophets and righteous men as places of worship, but you must not take the graves as Masjids; I forbid you to do that.
There are many Hadiths to that effect, and we ask Allah to set right the affairs of (Part No. 1; Page No. 140) all Muslims and bestow on them good understanding of Islam. Indeed, Allah is the best One to be asked for help.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.