Ayesha reported,

The Messenger of Allah ﷺ said during the illness from which he never rose, "May Allah curse the Jews and the Christians, for they took the graves of their prophets as places of worship."She said, "Were it not for that, his grave would have been made prominent, but it was feared that it would be taken as a place of worship."In the narration of Ibn Abu Shayba, the wording is, "Were it not for that," without her saying, "She said."

Muslim 1184

Sahih

حدثنا أبو بكر بن أبي شيبة وعمرو الناقد قالا حدثنا هاشم بن القاسم حدثنا شيبان عن هلال بن أبي حميد عن عروة بن الزبير

عن عائشة قالت

قال رسول الله ﷺ في مرضه الذي لم يقم منه لعن الله اليهود والنصارى اتخذوا قبور أنبيائهم مساجد قالت فلولا ذاك أبرز قبره غير أنه خشي أن يتخذ مسجدا وفي رواية ابن أبي شيبة ولولا ذاك لم يذكر قالت

مسلم 1184صحيح
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 1184
Muslim 1184