The Messenger of Allah ﷺ said during the illness from which he never recovered, "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 he feared that it would be taken as a place of worship."
قال رسول الله ﷺ في مرضه الذي لم يقم منه: لعن الله اليهود والنصارى اتخذوا قبور أنبيائهم مساجد قالت: فلولا ذاك لأبرز قبره غير أنه خشي أن يتخذ مسجدا.
Bukhari narrated it in Al-Maghazi (4441) and Muslim in Al-Masajid (529:19), both through the route of Hilal bin Abu Humayd Al-Wazzan, from Urwa bin Zubayr, from Ayesha, and he mentioned it.