كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
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 530 b

Abu Huraira reported:

The Messenger of Allah (ﷺ) said: Let there be curse of Allah upon the Jews and the Christians for they have taken the graves of their apostles as places of worship.
وَحَدَّثَنِي قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا الْفَزَارِيُّ، عَنْ عُبَيْدِ اللَّهِ بْنِ الأَصَمِّ، حَدَّثَنَا يَزِيدُ بْنُ الأَصَمِّ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ لَعَنَ اللَّهُ الْيَهُودَ وَالنَّصَارَى اتَّخَذُوا قُبُورَ أَنْبِيَائِهِمْ مَسَاجِدَ ‏"‏ ‏.‏
Reference : Sahih Muslim 530b
In-book reference : Book 5, Hadith 26
USC-MSA web (English) reference : Book 4, Hadith 1081
  (deprecated numbering scheme)