Someone asked, "Messenger of Allah, who are the most honorable of people?"He replied, "The most God-fearing among them."They said, "This is not what we are asking you about."He said, "Then it is Yusuf, the prophet of Allah, son of the prophet of Allah, son of the prophet of Allah, son of the friend of Allah."They said, "This is not what we are asking you about."He said, "Then you are asking me about the lineages of the Arabs. The best of them in the days of ignorance are the best of them in Islam, provided they gain understanding of the religion."
قيل: يا رسول الله! من أكرم الناس؟ قال: أتقاهم قالوا: ليس عن هذا نسألك قال: فيوسف نبي الله ابن نبي الله ابن نبي الله ابن خليل الله. قالوا: ليس عن هذا نسألك. قال: فعن معادن العرب تسألونني، خيارهم في الجاهلية خيارهم في الإسلام إذا فقهوا.
Bukhari related it in the hadiths of the prophets (3353), and Muslim in the virtues (2378), both of them through the route of Yahya bin Saeed, who said, Ubaydullah narrated to us, who said, Saeed bin Abu Saeed narrated to me, from his father, from Abu Hurairah, who said, and then he mentioned it. The wording given here is that of Muslim.