In the Sahih (i.e. AI-Bukhari and Muslim), ‘Aishah (May Allah be pleased with him) reported:
“Umm Salamah mentioned to Allah’s Messenger (pbuh) that in Abyssinia she saw a church full of pictures and statues. He (pbuh) a place of worship over his grave and set up all kinds of pictures and statues. They are the worst of all creatures before Allah. They combine the two evils; worshipping at the graves and-making graven images and statues.”
Also in Al-Bukhari and Muslim it is reported that `Aishah (r.a) narrated:
When the death approached Allah’s Messenger (pbuh) he began to draw a piece of cloth (bed sheet) over his face, (sometimes covering and sometimes removing because of distress), he (pbuh) said in this state: “Allah’s curse be upon the Jews and the Christians for taking the graves of their Prophets as places of worship.” Thus he (pbuh) warned the people about their actions. Had there not been any fear of making the Prophet’s grave a place of worship, his (pbuh) grave would have been as open as the graves of his Companions (r.a).
Muslim reported from Jundub bin Abdullah ( r.a) who narrated:
I heard the Prophet (pbuh) say only five days before his death: “I am free and clear towards Allah of having any of you as my Khalil (especially close friend). Verily, Allah has taken me as His Khalil just as He had taken Ibrahim ( pbuh) as a Khalil. If I would have taken anyone from my Ummah as a Khalil, I would have taken Abu Bakr ( pbuh) as a Khalil.
Beware! Those who proceeded before you, used to make their Prophets’ graves into places of worship. Beware! Don’t take (any) graves as places of worship. I forbid you to do so.”
He (pbuh) forbade this at the end of his life.
After this [forbidding of taking graves as Masjid (place of worship)], he cursed anyone who did any such deed within this context. Prayer at the graves is one of these deeds, even if no Masjid has been built. This is the meaning of his (pbuh) words “He feared (his grave) would be taken as a Masjid”. The Companions never built any place of worship around his grave. Any place which is intended for prayer or where prayer is performed has indeed been taken as a Masjid. Just as the Prophet (pbuh) said:
“The whole earth has been made for me a Masjid and it is pure and clean.”
Ahmad has reported with a good Sanad that Ibn Mas’ud (r.a) narrated in a Marfu’ Hadith (tradition traced to the Prophet (pbuh) himself):
“The most evil men are those upon whom the (signs of) Hour (of Resurrection) comes while they are still alive, and those who take graves as places of worship (Masjid)”. [This tradition was also reported by Abu Hatim in his Sahih.]