Asim reported,

I asked Anas bin Malik, "Did the Messenger of Allah declare Madinah a sanctuary?"He replied, "Yes, the area between such-and-such. Whoever introduces a heresy into it or shelters one who does so." Then he said to me, "This one is severe. Upon him is the curse of Allah, the angels, and all people. Allah will accept from him no obligatory worship nor voluntary deed on the Day of Resurrection."

Azami 10645

Sahih

حدثنا عاصم، قال

قلت لانس بن مالك: احرم رسول الله المدينة؟ قال: نعم ما بين كذا وكذا، فمن احدث فيها حدثا او اوي محدثا قال: ثم قال لي: هذه شديدة فعليه لعنة الله والملائكة والناس اجمعين. لا يقبل الله منه يوم القيامة صرفا ولا عدلا.

الأعظمي 10645صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Virtues of the lands
Chapter
Virtue of the Prophet's Madinah
Section
Sin of one who commits an offense in Madinah or shelters an offender
Numbering
Jami al-Kamil 10645 (2nd edition)
Azami 10645