The Holy Quran has clearly ruled in favour of building graves over mosques as documented in Surah Kahf (18): Verse 21:

فَقَالُوا ابْنُوا عَلَيْهِم بُنْيَانًا ۖرَّبُّهُمْ أَعْلَمُ بِهِمْ ۚ قَالَ الَّذِينَ غَلَبُوا عَلَىٰ أَمْرِهِمْ لَنَتَّخِذَنَّ عَلَيْهِم مَّسْجِدًا

And they said: Construct upon them a building. The second group said – Let us build a mosque on their graves (in the cave) (and thus seek blessings through this act). Surah Kahf (18): Verse 21

Yet we find the skeptics advancing arguments against this verse which can best be described as illogical and baseless.

  • First they rather ridiculously claim – the group that prevailed regarding building mosques were disbelievers so their opinion does not count! 
  • Next they claim (after realizing the ridiculousness of the first argument) that even if they were Muslims, it was permitted in earlier religions but Islam abrogated all such (polytheistic) practices.

Reply to the argument of the skeptics against Surah Kahf (18): Verse 21

We are at a loss to determine which of the two arguments is more ridiculous.

    1. Their claim that the group that prevailed in building mosques were disbelievers can only be described as preposterous. We do not know since when the disbelievers started worshipping Allah in mosques.
    1. Their claim that even if they were Muslims, this was a practice of earlier religions and Islam abrogated all such practices is even weaker than the previous argument as it shows poor insight in Islam and Islamic beliefs. Islam has not abrogated principles of Tauheed and apostasy (Usool-e-Deen) only the laws related to acts of worship like prayers, fasting, punishment for crimes, etc. Building mosques over graves is a matter of Tauheed/Shirk according to these Muslims, which is why they oppose it so vehemently. Principles of Tauheed remain constant according across all religions revealed by Allah and cannot be abrogated by subsequent religions. Are these Muslims suggesting that Allah allowed polytheism in the past (through building of mosques over graves) and abrogated it subsequently through Tauheed with the advent of Islam?
    1. Also these Muslims ignore another pertinent point in the incident of Ashaab-e-Kahf, that of consensus (ijmaa). The verse clearly states that the group that prevailed suggested building of a mosque – Those who prevailed in their affair said: We will certainly raise a mosque over their graves. This proves ijmaa was with the second group in building a mosque over the grave. Since ijmaa is very critical for these Muslims and opposing it is not permissible they have to respect the decision of the Muslims of that period, as also this period, to build mosques over graves. Imam Shahab al-Deen Khafaji: (Building mosque on cave in Surah Kahf (18): Verse 21) is proof of making mosques over the graves of righteous (saaliheen) just like it is mentioned in Tafsir al-Kashaaf of Zamakhshari and it is permitted to pray inside this construction. (Inaayat al-Qazi vol 6 pg 87, published by Dar al-Sadir, Beirut, Lebanon) 
    1. Mullah Ali Qari: Anyone who builds a mosque near the grave of righteous person or prays in the tomb (maqbarah) or intends to ask for help through the soul of that righteous person or intends to seek blessings (barakah) from his leftovers, if he does all that without the intention of giving him ta’zeem (giving him the respect reserved for Allah) or doing tawajjuh (attention) towards him (in prayer) – Then there is nothing wrong in that. Don’t you see that grave of Hazrat Ismail (a.s.) is inside the Masjidul Haraam near the hateem and to pray there is superior than in other places. However to pray near the graves is only forbidden when the soil becomes dirty because of najaasat (impurity) of the deceased. In the hateem near Hajr al-Aswad and mizaab there are graves of 70 prophets. (Mirqaat, Sharh al-Mishqaat vol 2 pg 202)
    1. He further states: The early Muslims (Salaf) have considered it mubaah (permissible) to build over the graves of famous mashaikh (teachers, elders) and ulama (scholars) so that people can visit them and sit there (easily). (Mirqaat, Sharh al-Mishqaat vol 2 pg 69)

It should be apparent to the unbiased reader that the vast majority of Muslim scholars advocate building of mosques over graves. Names like Ibn Kathir, student of Ibne Taymiyyah, Imam Ibn Hajr al-Asqalaani, Imam Fakhruddeen al-Raazi, Imam Jalaal al-Deen al-Suyuti and Al-Muhalli need no introduction and are not to be dismissed when they have concluded a matter based on their understanding of Quran and Sunnah.

Part One:

http://www.seratonline.com/23661/permissibility-of-building-mosques-over-graves-verdict-of-the-quran-part-one/

Part Three:

http://www.seratonline.com/23658/permissibility-of-building-mosques-over-graves-verdict-of-the-quran-part-three/