What is the ruling on performing Prayer in mosques that have graves on them?
حكم الصلاة في المساجد التي بها قبور
Praise be to Allah, and may Allah’s peace and blessings be upon the Messenger of Allah, his family and his companions.
As to what follows:
With regards to answering your question we say, success is by Allah Almighty.
Many scholars have said that there is consensus which says that a mosque should not be built on a grave. This is evidenced by many texts prohibiting that. From these texts is a hadith narrated by Muslim on the authority of Jundub Ibn Abdullah who said that The Prophet (peace be on 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 graves as mosques; I forbid you to do that.”
In addition to that, The Prophet (peace be on him) cursed those who take prophets’ graves as places of worship. This is evidenced by a hadith narrated by Bukhari and Muslim and others on the authority of Ibn Abas (may Allah be pleased with them) who said that:
“Allah's curse be on the Jews and the Christians, as they took the graves of their prophets as (places of worship),' intending to warn (the Muslims) of what they had done.”
Another curse is mentioned in a hadith narrated by Bukhari and Muslim on the authority of Aisha (may Allah be pleased with her).
If the mosque is built on a grave then it is compulsory to destroy the mosque, but if the mosque is built before the grave is placed then it is compulsory to exhume the grave and bury the deceased at a Muslim graveyard.
The ruling on performing Prayer in mosques that are built on graves is that it is impermissible. The scholars have said that this impermissibility is either haram or makruh. However, what is apparent is that it is haram if the mosque is built on a grave, whereas if the masjid was built first then Prayer will be correct but it will be obligatory to remove the grave by exhuming it. If the grave is old such that there is a possibility that the body decayed then it is sufficient to change the grave’s appearance by levelling it with the ground.
And Allah knows best.
Dr. Khalid al-Muslih
10 / 03 / 1425 AH