Sahih al-Bukhari, Hadith 1870 ⓘ
Narrated `Ali: We have nothing except the Book of Allah and this written paper from the Prophet (wherein is written:) Medina is a sanctuary from the 'Air Mountain to such and such a place, and whoever innovates in it an heresy or commits a sin, or gives shelter to such an innovator in it will incur the curse of Allah, the angels, and all the people, none of his compulsory or optional good deeds of worship will be accepted. And the asylum (of protection) granted by any Muslim is to be secured (respected) by all the other Muslims; and whoever betrays a Muslim in this respect incurs 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 whoever (freed slave) befriends (take as masters) other than his manumitters without their permission incurs the curse of Allah, the angels, and all the people, and none of his compulsory or optional good deeds of worship will be accepted.
حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا عَبْدُ الرَّحْمَنِ، حَدَّثَنَا سُفْيَانُ، عَنِ الأَعْمَشِ، عَنْ إِبْرَاهِيمَ التَّيْمِيِّ، عَنْ أَبِيهِ، عَنْ عَلِيٍّ ـ رضى الله عنه ـ قَالَ مَا عِنْدَنَا شَىْءٌ إِلاَّ كِتَابُ اللَّهِ، وَهَذِهِ الصَّحِيفَةُ عَنِ النَّبِيِّ صلى الله عليه وسلم " الْمَدِينَةُ حَرَمٌ، مَا بَيْنَ عَائِرٍ إِلَى كَذَا، مَنْ أَحْدَثَ فِيهَا حَدَثًا، أَوْ آوَى مُحْدِثًا، فَعَلَيْهِ لَعْنَةُ اللَّهِ وَالْمَلاَئِكَةِ وَالنَّاسِ أَجْمَعِينَ، لاَ يُقْبَلُ مِنْهُ صَرْفٌ وَلاَ عَدْلٌ ". وَقَالَ " ذِمَّةُ الْمُسْلِمِينَ وَاحِدَةٌ، فَمَنْ أَخْفَرَ مُسْلِمًا فَعَلَيْهِ لَعْنَةُ اللَّهِ وَالْمَلاَئِكَةِ وَالنَّاسِ أَجْمَعِينَ، لاَ يُقْبَلُ مِنْهُ صَرْفٌ وَلاَ عَدْلٌ، وَمَنْ تَوَلَّى قَوْمًا بِغَيْرِ إِذْنِ مَوَالِيهِ، فَعَلَيْهِ لَعْنَةُ اللَّهِ وَالْمَلاَئِكَةِ وَالنَّاسِ أَجْمَعِينَ، لاَ يُقْبَلُ مِنْهُ صَرْفٌ وَلاَ عَدْلٌ ".
also referenced under: Book 29, Hadith 4 (In-Book) & Volume 3, Book 30, Hadith 94 (USC-MSA)