Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(61)
Chapter: What is disliked of establishing places of worship (mosques) over the graves,
(61)
باب مَا يُكْرَهُ مِنِ اتِّخَاذِ الْمَسَاجِدِ عَلَى الْقُبُورِ
Sahih al-Bukhari 1330

Narrated `Urwa:

Aisha said, "The Prophet (ﷺ) in his fatal illness said, 'Allah cursed the Jews and the Christians because they took the graves of their Prophets as places for praying."' Aisha added, "Had it not been for that, the grave of the Prophet (p.b.u.h) would have been made prominent but I am afraid it might be taken (as a) place for praying.

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