The Prophet ﷺ said, "It is Taybah," meaning Madinah, "and it expels impurity just as fire expels the impurity of silver."
عن النبي ﷺ قال: إنها طيبة ( يعني المدينة) وإنها تنفي الخبث كما تنفى النار خبث الفضة.
Bukhari narrated it in the tafsir (4589), and Muslim in the Hajj (490:1384), both through Shubah, from Adi (who is Ibn Thabit), who heard Abdullah bin Yazid, from Zayd bin Thabit, who related it.The wording given is Muslim's, while Bukhari's version is longer and includes the story of the hypocrites turning back from the Battle of Uhud. It is found in the tafsir.