But if the passageway mentioned by the questioner actually encroaches upon the graves and cuts through them, this is not permissible, because the Prophet ﷺ forbade sitting on a grave, stepping on it, or passing across graves. Such actions harm the deceased and demean the graves, and we have been prohibited from them. Therefore, if the road runs through the graves and people walk over them, this is forbidden.
However, if the road does not cut through the graves and is instead separate from them, there is no objection, although, as we have already noted, a barrier should be erected between the roadway and the graves.
***
Prayer in a Mosque that Contains a Grave
Question: In our village there is a mosque that contains the grave of a shaykh known as al-Bustani. Is it permissible to remove this grave, which has been built inside the mosque, and incorporate that spot into the prayer area? Some people say that doing so is wrong, while others say that the shaykh can neither harm nor benefit, so there is no need to remove it. It should also be noted that there is a chamber in which animals are slaughtered as vows and similar offerings. What are we required to do about it? Kindly advise us—may Allah grant you success.
Answer: The Prophet ﷺ warned very sternly against constructing mosques over graves and turning them into places of worship. He issued the severest threats in this regard. He ﷺ said, “Allah’s wrath was most intense against a people who turned the graves of their prophets and righteous men into mosques.” He ﷺ also said, “Those who came before you used to take the graves of their prophets as mosques; beware—do not take graves as mosques.”