Hadithcore
Mishkat al-Masabih, 201

Abu Huraira reported God's messenger as saying, “Men are of different origins just as gold and silver are; the best among them in the pre-Islamic period are the best among them in Islam when they are versed in the religion.” Muslim transmitted it.

وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «النَّاسُ مَعَادِنُ كَمَعَادِنِ الذَّهَبِ وَالْفِضَّةِ خِيَارُهُمْ فِي الْجَاهِلِيَّةِ خِيَارُهُمْ فِي الْإِسْلَامِ إِذَا فَقِهُوا» . رَوَاهُ مُسلم

References1 variant
In-Book Reference
Book 2, Hadith 4