Mosques and Graves
Question: Our mosque had an imām who, before his death, stipulated in his will that when he died he should be buried directly in front of the mosque’s qiblah. Is such a request valid? Kindly clarify—may Allah reward you.
Answer: This bequest is invalid. It is not permissible for anyone to be buried inside a mosque or along its qiblah wall; rather, the deceased must be laid to rest in the public cemetery with the rest of the Muslims.
The Prophet ﷺ explicitly forbade burial inside mosques and prohibited turning graves into places of worship. He cursed those who do so, warning his community at the time of his passing that this practice was characteristic of the Jews and Christians. Moreover, burying someone in a mosque is a pathway to associationism: people begin to believe that the occupant of the grave can benefit or harm, that he possesses some special power that warrants seeking nearness to him through acts of devotion other than to Allah. Such behaviour is the way of idol-worshippers and polytheists.
Muslims must therefore stay alert to this grave danger. Every mosque should be free of graves, established solely upon the oneness of God and sound creed. Allah the Exalted says: “And indeed, the mosques belong to Allah, so do not call upon anyone along with Allah.” (al-Jinn 18)
Thus, mosques must be dedicated exclusively to Allah and cleansed of all traces of associationism, so that the worship performed therein is directed to Him alone, without partner. This is what the Muslim community is obliged to uphold. Allah is the One who grants success.