كتاب الحج
15  
The Book of Pilgrimage
(85)
Chapter: The virtue of Al-Madinah and the Prophet's Prayer for it to be blessed. Its sanctity and the sanctity of its game and trees. The Boundaries of its sanctuary
(85)
باب فَضْلِ الْمَدِينَةِ وَدُعَاءِ النَّبِيِّ صلى الله عليه وسلم فِيهَا بِالْبَرَكَةِ وَبَيَانِ تَحْرِيمِها وَتَحْرِيمِ صَيْدِهَا وَشَجَرِهَا وَبَيَانِ حُدُودِ حَرَمِهَا
Sahih Muslim 1371 a

Abu Huraira (Allah be pleased with him) reported Allah's Apostle (ﷺ) as saying:

Medina is a sacred territory, so he who made any innovation in it. or gave protection to an innovator, there is upon him the curse of Allah, that of the angels and that of all the people. There would not be accepted on the Day of Resurrection either obligatory acts or supererogatory acts from him.
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا حُسَيْنُ بْنُ عَلِيٍّ الْجُعْفِيُّ، عَنْ زَائِدَةَ، عَنْ سُلَيْمَانَ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ الْمَدِينَةُ حَرَمٌ فَمَنْ أَحْدَثَ فِيهَا حَدَثًا أَوْ آوَى مُحْدِثًا فَعَلَيْهِ لَعْنَةُ اللَّهِ وَالْمَلاَئِكَةِ وَالنَّاسِ أَجْمَعِينَ لاَ يُقْبَلُ مِنْهُ يَوْمَ الْقِيَامَةِ عَدْلٌ وَلاَ صَرْفٌ ‏"‏ ‏.‏
Reference : Sahih Muslim 1371a
In-book reference : Book 15, Hadith 534
USC-MSA web (English) reference : Book 7, Hadith 3166
  (deprecated numbering scheme)