كتاب الحج
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 b

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."
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ النَّضْرِ بْنِ أَبِي النَّضْرِ، حَدَّثَنِي أَبُو النَّضْرِ، حَدَّثَنِي عُبَيْدُ اللَّهِ، الأَشْجَعِيُّ عَنْ سُفْيَانَ، عَنِ الأَعْمَشِ، بِهَذَا الإِسْنَادِ ‏.‏ مِثْلَهُ وَلَمْ يَقُلْ ‏"‏ يَوْمَ الْقِيَامَةِ ‏"‏ وَزَادَ ‏"‏ وَذِمَّةُ الْمُسْلِمِينَ وَاحِدَةٌ يَسْعَى بِهَا أَدْنَاهُمْ فَمَنْ أَخْفَرَ مُسْلِمًا فَعَلَيْهِ لَعْنَةُ اللَّهِ وَالْمَلاَئِكَةِ وَالنَّاسِ أَجْمَعِينَ لاَ يُقْبَلُ مِنْهُ يَوْمَ الْقِيَامَةِ عَدْلٌ وَلاَ صَرْفٌ ‏"‏ ‏.‏
Reference : Sahih Muslim 1371b
In-book reference : Book 15, Hadith 535
USC-MSA web (English) reference : Book 7, Hadith 3167
  (deprecated numbering scheme)