كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(3)
Chapter: The prohibition of building masajid over graves and placing images therein; and the prohibition of taking graves as masajid
(3)
باب النَّهْيِ عَنْ بِنَاءِ الْمَسَاجِدِ عَلَى الْقُبُورِ وَاتِّخَاذِ الصُّوَرِ فِيهَا وَالنَّهْيِ عَنِ اتِّخَاذِ الْقُبُورِ مَسَاجِدَ
Sahih Muslim 528 a

'A'isha reported:

Umm Habiba and Umm Salama made a mention before the Messenger of Allah (ﷺ) of a church which they had seen in Abyssinia and which had pictures in it. The Messenger of Allah (ﷺ) said: When a pious person amongst them (among the religious groups) dies they build a place of worship on his grave, and then decorate it with such pictures. They would be the worst of creatures on the Day of judgment in the sight of Allah.
وَحَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، حَدَّثَنَا هِشَامٌ، أَخْبَرَنِي أَبِي، عَنْ عَائِشَةَ، أَنَّ أُمَّ حَبِيبَةَ، وَأُمَّ سَلَمَةَ ذَكَرَتَا كَنِيسَةً رَأَيْنَهَا بِالْحَبَشَةِ - فِيهَا تَصَاوِيرُ - لِرَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِنَّ أُولَئِكِ إِذَا كَانَ فِيهِمُ الرَّجُلُ الصَّالِحُ فَمَاتَ بَنَوْا عَلَى قَبْرِهِ مَسْجِدًا وَصَوَّرُوا فِيهِ تِلْكَ الصُّوَرَ أُولَئِكِ شِرَارُ الْخَلْقِ عِنْدَ اللَّهِ يَوْمَ الْقِيَامَةِ ‏"‏ ‏.‏
Reference : Sahih Muslim 528a
In-book reference : Book 5, Hadith 21
USC-MSA web (English) reference : Book 4, Hadith 1076
  (deprecated numbering scheme)