The Messenger of Allah ﷺ said, "May Allah curse the Jews, for they took the graves of their prophets as places of worship."
حدثنا الخزاعي قال أخبرنا ليث عن يزيد بن الهاد عن ابن شهاب عن سعيد بن المسيب
قال رسول الله ﷺ لعن الله اليهود اتخذوا قبور أنبيائهم مساجد
Its chain of transmission is sahih. Muslim also related, regarding the prohibition of praying facing graves, the saying of the Messenger ﷺ, "Do not pray facing the graves, and do not sit on them."