the motive of prayer and prostration within it; each necessarily implies the other, as al-Munāwī observes in al-Fayḍ. It is self-evident that the accursed Jews and Christians built those sanctuaries only so that they might pray in them. Hence anyone who performs prayer in a mosque that contains a grave—even though he does not intend the grave itself—has resembled those who incurred wrath and went astray, and we have been forbidden to imitate them in both general and specific texts. For that reason the scholar Ibn al-Malik—one of our Ḥanafī authorities—said in his commentary on the previously mentioned ḥadith of Ibn ʿAbbās: “The establishment of mosques over graves was prohibited because praying in them is to follow the practice of the Jews.” Shaykh ʿAlī al-Qārī transmits this statement in al-Mirqāt.
In addition to the foregoing, praying in mosques built over graves may lead the worshiper himself—or those common people and ignoramuses who follow him—to single out the deceased for acts of worship that belong solely to Allah, such as seeking deliverance from him or prostrating to him. This is exactly what occurs in most grave-mosques, as can be observed. The practice was therefore forbidden as a means of blocking that avenue, just as prayer is forbidden at the three prohibited times—indeed, the corruption found in those mosques is clearer and more blatant than the corruption feared at those times, as reality attests.
All of this concerns someone who did not set out with the intention of praying in such mosques. As for the one who deliberately seeks them out for the sake of the occupant of the grave, seeking blessing from him and believing that prayer there is superior to prayer in mosques free of graves, this is outright opposition and defiance of Allah and His Messenger. The prayer of such a person rightly merits the verdict of invalidity pronounced by some scholars, as will be mentioned shortly.