The Messenger of Allah ﷺ said, "May Allah curse the Jews and the Christians, for they took the graves of their prophets as places of worship."
أخبرنا محمد بن عبد الرحيم أبو يحيى صاعقة قال حدثنا أبو سلمة الخزاعي قال حدثنا الليث بن سعد عن يزيد بن الهاد عن ابن شهاب عن سعيد بن المسيب
أن رسول الله ﷺ قال لعن الله اليهود والنصارى اتخذوا قبور أنبيائهم مساجد
Recorded by Bukhari, Prayer, chapter 55, hadith 437, and Muslim, Masjids, chapter on the prohibition of building a masjid over graves etc., hadith 530, from the hadith of Ibn Shihab Zuhri with this same wording, and it is in Al-Kubra, hadith 2174.