Ayesha and Abdullah bin Abbas reported,

When the Messenger of Allah ﷺ was in the throes of death, he began to throw a cloak of his over his face. When it caused him distress, he would uncover his face. While in that state, he said, "May the curse of Allah be upon the Jews and the Christians. They took the graves of their prophets as places of worship," warning against doing what they had done.

Muslim 1187

Sahih

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

عائشة وعبد الله بن عباس قالا

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

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