It is impermissible to
build Masjids over the graves of the righteous servants of Allah. (Part No. 1; Page No. 405) It is also impermissible to offer Salah in such Masjids, because the Prophet (peace be upon him) said,
“May Allah curse
the Jews and
the Christians, for they have taken the graves of their Prophets as places of worship.”
(Agreed upon its authenticity by both Imam Bukhari and Imam Muslim).
The Prophet (peace be upon him) also said,
“Beware! Those who came before 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.”
Muslim in his Sahih (Book of Authentic Hadith).
Muslim also reported that
Jabir ibn ‘Abdullah (may Allah be pleased with him) said,
The Messenger of Allah (peace be upon him) forbade plastering of graves, sitting on them, or building over them.
May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.