Ayesha reported,

When the Prophet ﷺ fell ill, some of his wives mentioned a church they had seen in the land of Abyssinia called Mariya. Umm Salama and Umm Habiba had been to the land of Abyssinia, and they spoke of its beauty and the images inside it.He raised his head and said, "Those people, when a righteous man among them died, would build a place of worship over his grave and then make these images in it. Those are the worst of creation in the sight of Allah."

Azami 3786

Sahih

عن عائشة قالت

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

الأعظمي 3786صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Graves
Section
Prohibition of building a masjid over a grave
Numbering
Jami al-Kamil 3786 (2nd edition)
Azami 3786