Language:
كتاب الصلاة
8  
Prayers (Salat)
(48)
Chapter: Is it permissible to dig the graves of pagans of the period of Ignorance, and to use that place as a mosque?
(48)
بَابُ هَلْ تُنْبَشُ قُبُورُ مُشْرِكِي الْجَاهِلِيَّةِ، وَيُتَّخَذُ مَكَانَهَا مَسَاجِدَ
Sahih al-Bukhari 427

Narrated `Aisha:

Um Habiba and Um Salama mentioned about a church they had seen in Ethiopia in which there were pictures. They told the Prophet (ﷺ) about it, on which he said, "If any religious man dies amongst those people they would build a place of worship at his grave and make these pictures in it. They will be the worst creature in the sight of Allah on the Day of Resurrection."

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