Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(70)
Chapter: Building a mosque (a place of worship) at a grave
(70)
باب بِنَاءِ الْمَسْجِدِ عَلَى الْقَبْرِ
Sahih al-Bukhari 1341

Narrated `Aisha:

When the Prophet (ﷺ) became ill, some of his wives talked about a church which they had seen in Ethiopia and it was called Mariya. Um Salma and Um Habiba had been to Ethiopia, and both of them narrated its (the Church's) beauty and the pictures it contained. The Prophet (ﷺ) raised his head and said, "Those are the people who, whenever a pious man dies amongst them, make a place of worship at his grave and then they make those pictures in it. Those are the worst creatures in the Sight of Allah."

حَدَّثَنَا إِسْمَاعِيلُ، قَالَ حَدَّثَنِي مَالِكٌ، عَنْ هِشَامٍ، عَنْ أَبِيهِ، عَنْ عَائِشَةَ ـ رضى الله عنها ـ قَالَتْ لَمَّا اشْتَكَى النَّبِيُّ صلى الله عليه وسلم ذَكَرَتْ بَعْضُ نِسَائِهِ كَنِيسَةً رَأَيْنَهَا بِأَرْضِ الْحَبَشَةِ، يُقَالُ لَهَا مَارِيَةُ، وَكَانَتْ أُمُّ سَلَمَةَ وَأُمُّ حَبِيبَةَ ـ رضى الله عنهما ـ أَتَتَا أَرْضَ الْحَبَشَةِ، فَذَكَرَتَا مِنْ حُسْنِهَا وَتَصَاوِيرَ فِيهَا، فَرَفَعَ رَأْسَهُ فَقَالَ ‏ "‏ أُولَئِكَ إِذَا مَاتَ مِنْهُمُ الرَّجُلُ الصَّالِحُ بَنَوْا عَلَى قَبْرِهِ مَسْجِدًا، ثُمَّ صَوَّرُوا فِيهِ تِلْكَ الصُّورَةَ، أُولَئِكَ شِرَارُ الْخَلْقِ عِنْدَ اللَّهِ ‏"‏‏.‏
Reference : Sahih al-Bukhari 1341
In-book reference : Book 23, Hadith 96
USC-MSA web (English) reference : Vol. 2, Book 23, Hadith 425
  (deprecated numbering scheme)