Jundab reported,

I heard the Prophet ﷺ say, five days before his death, "I declare before Allah that I have taken none of you as an intimate friend, for Allah the Exalted has taken me as His intimate friend, just as He took Ibrahim as an intimate friend. Were I to take anyone from my community as an intimate friend, I would have taken Abu Bakr. Beware, those who came before you used to take the graves of their prophets and righteous ones as places of worship. Beware, do not take graves as places of worship. I forbid you from doing so."

Muslim 1188

Difficult

حدثنا أبو بكر بن أبي شيبة وإسحق بن إبراهيم واللفظ لأبي بكر قال إسحق أخبرنا وقال أبو بكر حدثنا زكرياء بن عدي عن عبيد الله بن عمرو عن زيد بن أبي أنيسة عن عمرو بن مرة عن عبد الله بن الحارث النجراني قال حدثني

جندب قال

سمعت النبي ﷺ قبل أن يموت بخمس وهو يقول إني أبرأ إلى الله أن يكون لي منكم خليل فإن الله تعالى قد اتخذني خليلا كما اتخذ إبراهيم خليلا ولو كنت متخذا من أمتي خليلا لاتخذت أبا بكر خليلا ألا وإن من كان قبلكم كانوا يتخذون قبور أنبيائهم وصالحيهم مساجد ألا فلا تتخذوا القبور مساجد إني أنهاكم عن ذلك

مسلم 1188مشكل
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Prohibition of building mosques over graves, placing images in them, and taking graves as mosques
Numbering
Darussalam 1188
Muslim 1188