Q: Brother M. A. N. from Mit Tarif Daqahliyyah Egypt, asks: Is it permissible to offer Salah (Prayer) in the Masjids (mosques) containing graves?
The remains in every grave should be buried in a separate hole as is the case for all graves. It is not permissible that a grave remains in a Masjid, whether the grave of a Waliy (pious person) or any other. The Messenger (peace be upon him) prohibited and warned against this cursing the Jews and the Christians for this practice.
May Allah curse the Jews and the Christians, for they have taken the graves of their Prophets as places of worship
'Aishah (may Allah be pleased with her) said: "He was warning against (doing) what they did."(Agreed upon by AlBukhari and Muslim).
When a pious person among those people dies, they build a place of worship on his grave, and then make such pictures in it. Those are the evilest creatures in the Sight of Allah.
Beware! Those who preceded you used to take the graves of their Prophets and righteous people as places of worship. Do not take graves as places of worship; I forbid you to do that.
(Related by Muslim in his Sahih [Authentic Hadith Book] on the authority of Jundub ibn 'Abdullah AlBajaly)
He (peace be upon him) forbade building places of worship over graves, cursed those who did so, and stated that these are the worst of creatures. So, it is obligatory to warn against this practice. It is wellknown that whoever offers Salah at a grave, in fact takes it as a Masjid and those who build places of worship over it, take it as a Masjid. It is obligatory to keep graves away from the Masjids and not to place graves inside them in compliance to the command of the Messenger (peace be upon him) and to be aware of the Curse that Allah (Glorified and Exalted be He) placed on those who built Masjids over graves. When one offers Salah in Masjids which contain graves, Satan may deceive them into supplicating to the dead, seeking their help, or prostrating to them. Doing so may cause them to fall into major Shirk (associating others with Allah in His Divinity or worship). This is one of the practices of the Jews and the Christians and it is obligatory to differ from them and avoid their practices and evil ways. However, if the grave is old and a Masjid is built over it, it is obligatory to demolish the Masjid because it is newly built, as held by the people of knowledge, in order to block the means which may lead to Shirk. May Allah grant us success!