Following is the background of Prophet Muhammad صلی اللہ علیہ وآلہ وسلم burial place:
The presence of the Prophet’s grave in his masjid in Madeenah can neither be used to justify the placing of bodies in other masjid s nor the building of masjids over graves. The Prophet (صلی اللہ علیہ وآلہ وسلم) did not order that he be buried in his masjid, nor did his companions put his grave into the masjid. The companions of the Prophet (RA) wisely avoided burying the Prophet (صلی اللہ علیہ وآلہ وسلم) in the local graveyard for fear that later generations would become overly attached to his grave.‘Umar, the freed slave of Ghafrah, related that when the Sahaabah (رَّضِيَ اللَّهُ عَنْهُمْ) gathered to decide on the Prophet’s (صلی اللہ علیہ وآلہ وسلم) burial, one said:“Let us bury him in the place where he used to pray.” Abu Bakr (رَّضِيَ اللَّهُ عَنْهُمْ) replied,“May Allaah protect us from making him an idol to be worshipped.” Others said,“Let us bury him in al-Baqee’ (a graveyard in Madeenah) where his brothers among the Muhaajireen (migrants from Makkah) are buried.” Abu Bakr (رَّضِيَ اللَّهُ عَنْهُمْ) replied:“Verily burying the Prophet (صلی اللہ علیہ وآلہ وسلم) in al-Baqee‘ is detestable because some people may try to seek refuge in him which is a right belonging only to Allaah. So, if we take him out (to the graveyard), we will ruin Allaah’s right, even if we carefully guard the Messenger’s grave.” They then asked,“What is your opinion, O Abu Bakr (رَّضِيَ اللَّهُ عَنْهُمْ)?” He replied,“I heard Allaah’s Messenger say:‘Allaah has not taken the life of any of his prophets except that were buried where they died.” Some of them said,“By Allaah, what you have said is pleasing and convincing.” Then they made a line around the Prophet’s (صلی اللہ علیہ وآلہ وسلم) bed in‘Aa’eshah’s (رَّضِيَ اللَّهُ عَنْهُمْ) house) and dug the grave where his bed was.‘Alee, al-‘Abbaas, al-Fadl, and the Prophet’s (صلی اللہ علیہ وآلہ وسلم) family took his body and prepared it for burial. [Collected by Ibn Zanjooyah and quoted by al-Albaanee in Tahdheer as-Saajid, (Beirut: al-
Maktab al-Islaamee, 2nd. ed., 1972), pp.13-4.]
‘Aa’eshah’s (رَّضِيَ اللَّهُ عَنْهُمْ) house was separated from the masjid by a wall and it had a door through which the Prophet (صلی اللہ علیہ وآلہ وسلم) used to enter the masjid to lead salaah . The companions (رَّضِيَ اللَّهُ عَنْهُمْ) sealed off this doorway in order to complete the separation of the Prophet’s (صلی اللہ علیہ وآلہ وسلم) grave from his masjid. Consequently, the only way that his grave could be visited at that time was from outside the masjid.
Expansions of the masjid took place in the time of the second Caliph‘Umar (رَّضِيَ اللَّهُ عَنْهُمْ) and the third Caliph‘Uthmaan (رَّضِيَ اللَّهُ عَنْهُمْ). But both of them cautiously avoided the inclusion of either‘Aa’eshah’s (رَّضِيَ اللَّهُ عَنْهُمْ) house or that of any of the other wives of the Prophet (صلی اللہ علیہ وآلہ وسلم). Expansion in the direction of the houses of the wives of the Prophet (صلی اللہ علیہ وآلہ وسلم) would have automatically included the Prophet’s grave in the masjid. However, after the death of all the Sahaabah who were in Medinah, [The last Sahaabee to die in Madeenah was Jaabir ibn‘Abdillaah. He died there in 699 CE during the reign of Caliph‘Abdul-Malik (reign 685-705 CE).]
Caliph al-Waleed ibn‘Abdil- Malik (reign 705-715 C.E.) was the first to extend the masjid in an easterly direction. He included‘Aa’eshah’s (رَّضِيَ اللَّهُ عَنْهُمْ) house inside the masjid, but demolished the houses of the other wives of the Prophet (صلی اللہ علیہ وآلہ وسلم). The expansion was reported to have been carried out by al-Waleed’s governor‘Umar ibn‘Abdul-‘Azeez.
When‘Aa’eshah’s (رَّضِيَ اللَّهُ عَنْهُمْ) house was included inside the masjid, a high circular wall was built around it so that it would not be visible at all from inside the masjid. Two additional walls were later built at an angle from the two northern corners of the house in such a way that they met each other forming a triangle. This was down to prevent anyone from facing the grave directly. [Narrated by al-Qurtubee and quoted in Tayseer al-‘Azeez al-Hameed, p.324.]
Many years later, the familiar dome was added to the roof of the masjid and was placed directly above the Prophet’s (صلی اللہ علیہ وآلہ وسلم) grave. [Sultan Kalawoon as-Salaahee built the first dome over the chamber in 1282 CE and it was first painted green by order of Sultan Abdul-Hameed in 1837 (see Ali Hafiz, Chapters from the History of Madinah, (Jeddah: Al-Madina Printing and Publication Co., 1st ed., 1987), pp.78-9).]
The grave was later surrounded by a brass cage with doors and windows, and the walls of the grave itself were draped in green cloth. In spite of the barriers which have been placed around the Prophet’s grave, the error still remains to be corrected. Walls should once again be placed to separate it from the masjid so that no one could pray in its direction nor visit it inside the masjid.
‘A’isha reported: The Messenger of Allah (may peace be upon him) said during his illness from which he never recovered: Allah cursed the Jews and the Christians that they took the graves of their prophets as mosques. She (‘A’isha) reported: Had it not been so, his (Prophet’s) grave would have been in an open place, but it could not be due to the fear that it may not be taken as a mosque. (Sahih Muslim; Book #004, Hadith #1079)