Language:
كتاب الجزية والموادعة
58  
Jizyah and Mawaada'ah
(17)
Chapter: The sin of a person who makes a covenant and then proves treacherous
(17)
بَابُ إِثْمِ مَنْ عَاهَدَ ثُمَّ غَدَرَ
Sahih al-Bukhari 3179

Narrated `Ali:

We did not, write anything from the Prophet (ﷺ) except the Qur'an and what is written in this paper, (wherein) the Prophet (ﷺ) said, "Medina is a sanctuary from (the mountain of) Air to so and-so, therefore, whoever innovates (in it) an heresy or commits a sin, or gives shelter to such an innovator, will incur the Curse of Allah. the angels and all the people; and none of his compulsory or optional good deeds of worship will be accepted And the asylum granted by any Muslim Is to be secured by all the Muslims even if it is granted by one of the lowest social status among them. And whoever betrays a Muslim in this respect will incur the Curse of Allah, the angels and all the people, and his compulsory and optional good deeds of worship will not be accepted. And any freed slave will take as masters (befriends) people other than his own real masters who freed him without taking the permission of the latter, will incur the Curse of Allah, the angels and all the people, and his compulsory and optional good deeds of worship will not be accepted."

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