Muwatta Malik, Book 45, Hadith 5 (USC-MSA) ⓘ
Malik related to me that Yahya ibn Said said, "I heard Abu'l-Hubab Said ibn Yasar say that he heard Abu Hurayra say that he heard the Messenger of Allah, may Allah bless him and grant him peace, say, 'I was ordered to a town which will eat up towns. They used to say, 'Yathrib,' but it is Madina. It removes the bad people like the blacksmith's furnace removes impurities from the iron.' "
وَحَدَّثَنِي مَالِكٌ، عَنْ يَحْيَى بْنِ سَعِيدٍ، أَنَّهُ قَالَ سَمِعْتُ أَبَا الْحُبَابِ، سَعِيدَ بْنَ يَسَارٍ يَقُولُ سَمِعْتُ أَبَا هُرَيْرَةَ، يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ " أُمِرْتُ بِقَرْيَةٍ تَأْكُلُ الْقُرَى يَقُولُونَ يَثْرِبُ . وَهِيَ الْمَدِينَةُ تَنْفِي النَّاسَ كَمَا يَنْفِي الْكِيرُ خَبَثَ الْحَدِيدِ " .
also referenced under: Book 45, Hadith 1605 (In-Book)