What is the ruling on praying in a mosque that has a room beside it containing a grave without a body, knowing that the mosque is named after the deceased?
It is not permissible to pray in mosques built upon graves, because that resembles the practice of the People of the Book, safeguards monotheism, and blocks the means to polytheism. A mosque built upon or next to a grave, or named after the occupant of a grave, contradicts the guidance of the Prophet (peace be upon him) and deviates from piety, as stated in His (the Almighty’s) saying: "Undoubtedly, a mosque founded on piety from the very first day is more worthy for you to stand therein [for prayer]." There is no difference between the presence of real or imaginary remains, for both are a tribulation and a means to polytheism. Many of the shrines attributed to the Companions and the Household of the Prophet are fabricated. The imams of Islam have agreed on the impermissibility of building shrines over graves, or taking them as mosques, or praying at them. Rather, the Sunnah when visiting a grave is to give salutations and supplicate for the deceased.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/2964