“Whoever prays in a cemetery or facing a grave must repeat the prayer for as long as he lives.” He then added:
“Abu Ḥanīfah, al-Awzaʿī, and Sufyān regarded it as disliked to pray toward a grave, inside a cemetery, or upon a grave, whereas Mālik saw no harm in it. Some of his followers tried to defend his view by citing the fact that the Messenger of Allah prayed at the grave of the poor black woman.”
Ibn Ḥazm remarked:
“This is truly astonishing! It is bad enough that these people oppose this very report in what it actually states: they will not permit the funeral prayer for one who has already been buried, yet—without any text or even a hint—they freely contravene the established sunnahs.”
He continued:
“All these reports are authentic. No prayer is lawful in the locations we have mentioned except the funeral prayer, for it may be offered in the cemetery and over the grave in which the deceased has been interred, exactly as the Messenger of Allah did. We forbid what he forbade, and we count it an act of drawing near to Allah to do what he did; his command and his prohibition are truth, his action is truth, and everything else is false. Praise belongs to Allah, Lord of the Worlds.”
After setting out the jurists’ opinions on the matter, al-Shawkānī said:
“The multiple-transmitted hadiths of prohibition, as Imām Ibn Ḥazm noted, are fully sufficient to establish the ruling of unlawfulness, which is the real meaning of a prohibition. It is an accepted principle in legal theory that a prohibition entails the invalidity of the act prohibited. Hence the correct view is that it is both forbidden and invalid, for the ‘corruption’ implied by the prohibition is synonymous with invalidity, with no distinction between praying on a grave and praying in graveyards—or in any place to which the word ‘cemetery’ applies.”
Shaykh al-Islām said in al-Ikhtiyārāt: