The following is a translation of the above fatwa:
As Imam Al-Shihab Ibn Hajar points out in his Major Edicts (Ar. Al-Fatawa Al-Kubra) in the chapter on funerals, our Shafi'i imams have taken four positions regarding building atop graves:
[*]The first position, which is the relied-upon position that Imams Nawawi and Rafi'i have codified and Imam Ibn Hajar and many late scholars have considered reliable, requires a distinction between graveyards that are endowments and like them, public graveyards -- these being where people of the area have become accustomed to burying their deceased -- and private property. Building atop a grave in a graveyard that is an endowment or public is unconditionally forbidden, whether the grave belongs to a scholar or someone else. As for if the grave is in private property, it is permissible to build atop it, but it is disliked to do so. The difference between the two is that the legal reason (Ar. `illah) for prohibiting building over graves is because it crowds out and denies access, making it difficult for people to bury another deceased in a grave that was built over. For this reason, it is forbidden in public graveyards but not in private ones.
[*]The second position is the unconditional permissibility of building atop graves, whether they are endowments, public, or otherwise, and whether they are the graves of scholars or laymen. In Al-Khadim, Imam Badr Al-Deen Al-Zarkashi quotes at length the words of the sheikh and imam, Sharaf Al-Deen Al-Ansari regarding the Qarafah [m: (a graveyard near Cairo)], during which he [m: i.e., Al-Zarkashi] says:The early Muslims (Ar. Salaf) (Allah be pleased with them) witnessed this greater and lesser graveyard in the past. Graves and structures were constructed in it, yet none of the scholars of the time opposed it in word or action. He [m: (i.e., Al-Ansari)] says, “they built the dome of Imam Al-Shafi'i (Allah be pleased with him) and his academy in it and the other shrines are like this.”
[m: After finishing up the quotation from Al-Ansari, Al-Zarkashi says: ]One of the late scholars said, “his [m: i.e. Al-Ansari's] words indicate that building in public graveyards is not forbidden.” And if it is not forbidden to build in public graveyards, then a fortiori, it is not forbidden to build in wastelands or private property with the permission of the owner.
[...]
In the Mustadrik, immediately after rigorously authenticating the hadiths on the prohibition of building and writing on graves, Imam Al-Hakim mentions, “These [m: hadiths] are not acted upon, for all Muslim imams, east and west, have structures over their graves, and this is something that the later generations (Ar. khalaf) took from the early generations (Ar. salaf). Al-Burzuli said, 'it is therefore a matter of consensus.'”
[...]
One of the late scholars of our imams mentioned beautiful words that support the permissibility of building atop graves, “[m: Scholars] have mentioned the validity of leaving a bequest to construct Al-Masjid Al-Aqsa and the graves of the prophets (peace and blessings of Allah be upon them). Sheikh Abu Muhammad incorporated the graves of scholars and the righteous under this [m: ruling] because it entails reviving visitation [m: of their shrines]. In Al-Waseet and Al-Ihya, Al-Ghazali says that which indicates the permissibility of building atop the graves of the scholars of religion, sheikhs of Islam, and other righteous people. It is not far-fetched that this permissibility is based on honouring them.
[...]
Like Al-Waseet and Al-Ihya, Sharh Al-Tanbeeh by Imam Ibn Al-Rif`ah contains that which indicates the permissibility of building [m: atop graves], or rather, its praiseworthiness. There is no doubt regarding this, for it is found in all the lands of Islam in the past and present.
[...]
None of the scholars or righteous people, who are the guardians of the religion, have been referenced as having opposed this in word or action, yet there is no doubt that they were able to do so. And Allah Most High knows best.
[*]The third position is the unconditional permissibility of building atop the graves of scholars, saints, and the righteous, whether in endowment lands or otherwise. As for building over the graves of non-scholars, it carries the distinction made in the first position. The differentiation between the graves of scholars and others -- in terms of honouring them and reviving their visitation -- becomes evident from what was narrated from Al-Ghazali and others in the second position; i.e. because visiting them increases aspiration for acquiring knowledge and righteousness, as is clear to many people.
[*]The fourth position is the unconditional prohibition [m: of building atop graves], regardless of whether in endowments or other lands, or whether the grave is for a scholar or someone else. Imam Shihab Al-Deen Al-Adhra`i chose this position because of the generality of the prohibition [m: found in the hadiths], and because [m: building atop graves] involves ugly innovation, wasting money, extravagance, showiness, and the imitation of tyrants and disbelievers.
The upshot is that those who have stated unconditional permissibility in this issue -- as well as those who have allowed it only for the graves of scholars and others similar to them -- have done so based on the practical ([m: as opposed to stated]) consensus of Muslim scholars in various eras that allowed building atop graves. This is particularly true regarding what was mentioned from Imam Al-Hakim, which should be reread. Based on this, it is possible to apply the prohibition of building atop graves that is found in the hadiths to it being merely disliked, except for the graves of scholars and others similar to them. [m: This exception] is because of what has already been mentioned regarding honouring them and reviving their visitation: it brings about aspiration for knowledge and righteousness. Furthermore, the erudite scholar, hadith master, and Prophetic scion, Ahmad Al-Ghumari composed a treatise on the permissibility of building atop graves of scholars and the righteous. In it, he puts forth the evidences and statements of Shafi'i imams and others who allow it.
Seeing that there is a scholarly difference of opinion regarding this matter, it is not permissible for anyone to refute one who practices it. As jurists have concurred, it is not permissible to refute that which scholars have differed over. Of course, it is praiseworthy to offer advice so that differences of opinion are avoided.
Allah is Most Knowledgeable regarding what is correct and to Him is the recourse and return.
Amjad Rasheed
(Translated by Sidi Moustafa Mounir Elqabbany, edited by Sidi Hamza Karamali)
As a matter of fact we have a hadith that says the following,
Dawud ibn Salih says: "[The Umayyad Caliph] Marwan [ibn al-Hakam] one day saw a man placing his face on top of the grave of the Prophet . He said: "Do you know what you are doing?" When he came near him, he realized it was Abu Ayyub al-Ansari. The latter said: "Yes; I came to the Prophet ,
not to a stone. I heard the Prophet say:
Do not weep on religion if its people assume its leadership (walyahu), but weep on it if other than its people assume it."
Ahmad 5:422, Hakim (Mustadrak 4:515); Imam Hakim declared the hadith as sahih and agreed upon by Al-Dhahabi. The hadith has also been narrated by as-Subki (Shifa' as-siqam p. 126), Ibn Taymiyya (al-Muntaqa 2:261f.), and al-Haythami (al-Zawa'id 4:2).
Notice that the hadith mentions "stone" which means that the Prophet's grave was already adorned with a structure in the time of Abu Ayyub Al-Ansari r.a.
It has been the tradition of Muslims from all over the world to adorn graves with structures, especially those of the 'ulama and awliya'. This is the concensus of the jumhur of the ummah. Recall that the Prophet s.a.w. instructed us to be with the sawad al-a'dham or the vast majority. Wallahu'alam bisawab.