An Arabi pledged allegiance to the Messenger of Allah ﷺ upon Islam. The Arabi then fell ill with a fever in Medina, so he came to the Messenger of Allah ﷺ and said, "Messenger of Allah, release me from my pledge."The Messenger of Allah ﷺ refused.The Arabi came to him again and said, "Release me from my pledge."He refused once more, so the Arabi departed.The Messenger of Allah ﷺ then said, "Medina is like a furnace. It expels its impurities and purifies what is good in it."
أخبرنا قتيبة عن مالك عن محمد بن المنكدر
أن أعرابيا بايع رسول الله ﷺ على الإسلام فأصاب الأعرابي وعك بالمدينة فجاء الأعرابي إلى رسول الله ﷺ فقال يا رسول الله أقلني بيعتي فأبى ثم جاءه فقال أقلني بيعتي فأبى فخرج الأعرابي فقال رسول الله ﷺ إنما المدينة كالكير تنفي خبثها وتنصع طيبها
Bukhari narrated it in the Book of Rulings, chapter of the pledge of the desert Arabs, hadith 7209, and Muslim narrated it in the Book of Hajj, chapter on Madinah expelling its impurities and being called Tabah and Taybah, hadith 1383, from the hadith of Malik through this same route. It is also found in Kubra, hadith 7808, and in Muwatta (Yahya), 2/886.