Sahih Muslim , Hadith 1371

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.

حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا حُسَيْنُ بْنُ عَلِيٍّ الْجُعْفِيُّ، عَنْ زَائِدَةَ، عَنْ سُلَيْمَانَ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ الْمَدِينَةُ حَرَمٌ فَمَنْ أَحْدَثَ فِيهَا حَدَثًا أَوْ آوَى مُحْدِثًا فَعَلَيْهِ لَعْنَةُ اللَّهِ وَالْمَلاَئِكَةِ وَالنَّاسِ أَجْمَعِينَ لاَ يُقْبَلُ مِنْهُ يَوْمَ الْقِيَامَةِ عَدْلٌ وَلاَ صَرْفٌ ‏" ‏ ‏.‏

sunnah.com

A hadith like this has been narrated on the authority of A'mash with the same chain of transmitters, but no mention has been made of the Day of Resurrection. But this addition is made: " The protection granted by Muslims is one and must be respected by the humblest of them. And he who broke the covenant made by a Muslim, there is a curse of Allah, of his angels, and of the whole people upon him, and neither an obligatory act nor a supererogatory act would be accepted from him as recompense on the Day of Resurrection."

وَحَدَّثَنَا أَبُو بَكْرِ بْنُ النَّضْرِ بْنِ أَبِي النَّضْرِ، حَدَّثَنِي أَبُو النَّضْرِ، حَدَّثَنِي عُبَيْدُ اللَّهِ، الأَشْجَعِيُّ عَنْ سُفْيَانَ، عَنِ الأَعْمَشِ، بِهَذَا الإِسْنَادِ ‏.‏ مِثْلَهُ وَلَمْ يَقُلْ ‏"‏ يَوْمَ الْقِيَامَةِ ‏"‏ وَزَادَ ‏"‏ وَذِمَّةُ الْمُسْلِمِينَ وَاحِدَةٌ يَسْعَى بِهَا أَدْنَاهُمْ فَمَنْ أَخْفَرَ مُسْلِمًا فَعَلَيْهِ لَعْنَةُ اللَّهِ وَالْمَلاَئِكَةِ وَالنَّاسِ أَجْمَعِينَ لاَ يُقْبَلُ مِنْهُ يَوْمَ الْقِيَامَةِ عَدْلٌ وَلاَ صَرْفٌ ‏"‏ ‏.‏

sunnah.com