The Prophet ﷺ said, "O Allah, do not make my grave an idol. Allah has cursed a people who took the graves of their prophets as places of worship."
حدثنا سفيان عن حمزة بن المغيرة عن سهيل بن أبي صالح عن أبيه
عن النبي ﷺ اللهم لا تجعل قبري وثنا لعن الله قوما اتخذوا قبور أنبيائهم مساجد
Its chain of transmission is sahih. Hamza bin Mughira bin Nashit (with a fatha on the nun) Makhzumi, Kufi, the devoted worshipper, is trustworthy. Ibn Hibban mentioned him among the trustworthy narrators, and Bukhari gave him a biographical entry in al-Kabir 2/1/44 without mentioning any criticism of him, as did Ibn Abu Hatim 2/1/214-215. It is reported from Ibn Main that he said, "There is no harm in him." Sufyan bin Uyayna narrated directly from Suhayl many hadiths, but he did not hear this particular hadith from him, so he narrated it from Hamza, from Suhayl.The second part of the hadith, concerning the curse upon those who take the graves of their prophets as places of worship, is established through many sahih chains from the hadith of Abu Hurairah, some of which will appear later at 7813 and 10727, and it is also established from narrators other than Abu Hurairah. As for the first part of it, "O Allah, do not make my grave an idol," Bukhari alluded to it in al-Kabir, as did Ibn Abu Hatim, both in the biographical entry on Hamza bin Mughira. Bukhari said, "Hamza bin Mughira, from Suhayl bin Abu Salih, from his father, from Abu Hurairah, the Prophet ﷺ said, 'Do not take my grave as an idol.'" Ali (that is, Ibn Madini) said, "Sufyan narrated to us, Hamza narrated to us." And Humaydi said, "Sufyan narrated to us, Hamza narrated to us." So Bukhari, as you see, narrated it through two teachers from Sufyan.Ibn Abu Hatim said, "Yaqub bin Ishaq Harawi informed us in what he wrote to me, Uthman bin Saeed Darimi narrated to us, who said, 'I asked Yahya bin Main about Hamza bin Mughira Kufi, from whom Ibn Uyayna narrates the hadith of the Prophet ﷺ, "Do not make my grave an idol."' He said, 'There is no harm in him.'"Malik narrated it in Muwatta 172 through another route, Malik from Zayd bin Aslam, from Ata bin Yasar, that the Messenger of Allah ﷺ said, "O Allah, do not make my grave an idol to be worshipped. The anger of Allah grew fierce against a people who took the graves of their prophets as places of worship." This is a mursal hadith. Ibn Saad narrated it in al-Tabaqat 2/2/25 from Maen bin Isa, from Malik.Suyuti said in Sharh Muwatta 1:186, "There is no disagreement about Malik narrating this hadith as mursal. It is a rare hadith, hardly found elsewhere." He said, "Bazzar claimed that no one followed Malik in narrating this hadith except Umar bin Muhammad, from Zayd bin Aslam, and it is not preserved from the Prophet ﷺ through any other route, having no chain besides this one, except that Umar bin Muhammad connected it through Abu Saeed Khudri, from the Prophet ﷺ. Umar bin Muhammad is trustworthy, and Thawri and a group of others narrated from him." He said, "As for his statement, 'The anger of Allah grew fierce against a people who took the graves of their prophets as places of worship,' it is preserved through many sahih routes." This is Bazzar's statement.Ibn Abdul-Barr said, "Malik is, according to all of them, an authority for what he transmits, and this hadith of his has indeed been given a connected chain by Umar bin Muhammad, who is among the trustworthy nobles of the people of Madinah. Malik bin Anas, Thawri, and Sulayman bin Bilal narrated from him. He is Umar bin Muhammad bin Zayd bin Abdullah bin Umar bin Khattab. So this hadith is sahih according to those who accept the mursal narrations of trustworthy narrators, and according to those who require a connected chain, because Umar bin Muhammad connected it, and he is among those whose additions are accepted."He then gave it a connected chain from Bazzar's book, through the route of Umar bin Muhammad, from Zayd bin Aslam, from Ata bin Yasar, from Abu Saeed Khudri, as a raised hadith, with the same wording as Muwatta. And from Aqeeli's book, through the route of Sufyan, from Hamza bin Mughira, from Suhayl bin Abu Salih, from his father, from Abu Hurairah, who said, "The Messenger of Allah ﷺ said, 'O Allah, do not make my grave an idol. Allah has cursed a people who took the graves of their prophets as places of worship.'"Some errors occurred in the printed edition of Suyuti's work. The name Sulayman bin Bilal was written as Sulaym, and Suhayl bin Abu Salih was written as Suhayl bin Salih. This is certainly a printing error, which we have corrected from Sharh Zurqani 1:314, since he, I believe, is quoting from Suyuti. We have also added to the lineage of Umar bin Muhammad bin Zayd, because this is how it appears in the chain of lineage, and we have benefited from Suyuti's quotation of Ibn Abdul-Barr, that Aqeeli narrated the hadith found here through the same route that Ahmad narrated it, namely from Sufyan's narration from Hamza bin Mughira.As for the hadith of Abu Saeed Khudri, which Ibn Abdul-Barr attributed to Bazzar, Haythami mentioned it in Majma al-Zawaid 2:28 with wording close to this, and said, "Bazzar narrated it, and it contains Umar bin Suhban, and they have unanimously agreed that he is weak." See also 3118.