Is it permissible to pray in a mosque built on the westernmost side of a graveyard, such that the graves are in the direction of the Qibla, knowing that the mosque was not built over the graves?
Prayer in this mosque is permissible, because it was not built upon graves, and a wall, other than the mosque's wall, separates it from them. Thus, it does not fall under the Prophet's (peace and blessings be upon him) prohibition against praying towards graves. This is due to what Sheikh Ibn Baz (may Allah have mercy on him) mentioned: "If there are graves in the direction of the mosque's qibla, the safest approach is to have another wall between the mosque and the graveyard, other than the mosque's wall, or a road separating them... However, if they are to the right of the mosque or to its left, meaning to the right or left of the worshippers, they do not harm them at all, because they are not facing them." The condition mentioned has been met in this mosque.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/95625