The Messenger of Allah ﷺ said, "A prophet will come on the Day of Judgment accompanied by two men, another prophet will come with three, and others with more or fewer than that. Each prophet will be asked, 'Did you convey the message to your people?'He will reply, 'Yes.'His people will then be summoned and asked, 'Did he convey the message to you?'They will say, 'No.'The prophet will then be asked, 'Who will bear witness for you?'He will say, 'Muhammad and his nation.'So the nation of Muhammad will be summoned and asked, 'Did this prophet convey the message?'They will say, 'Yes.'It will be asked, 'How did you come to know this?'They will reply, 'Our Prophet informed us that the messengers had indeed conveyed their messages, and we believed him.'"He said, "That is the meaning of Allah's statement, 'And thus We have made you a middle nation, that you may be witnesses over mankind and that the Messenger may be a witness over you' [Baqarah 2:143]."
حدثنا أبو كريب وأحمد بن سنان قالا حدثنا أبو معاوية عن الأعمش عن أبي صالح
قال رسول الله ﷺ يجيء النبي ومعه الرجلان ويجيء النبي ومعه الثلاثة وأكثر من ذلك وأقل فيقال له هل بلغت قومك فيقول نعم فيدعى قومه فيقال هل بلغكم فيقولون لا فيقال من يشهد لك فيقول محمد وأمته فتدعى أمة محمد فيقال هل بلغ هذا فيقولون نعم فيقول وما علمكم بذلك فيقولون أخبرنا نبينا بذلك أن الرسل قد بلغوا فصدقناه قال فذلكم قوله تعالى {وكذلك جعلناكم أمة وسطا لتكونوا شهداء على الناس ويكون الرسول عليكم شهيدا}
Bukhari narrated it in the Chapters on the Prophets, in the chapter on the saying of Allah, Mighty and Majestic, "And We had certainly sent Nuh to his people", hadith no. 3339/7349, from the hadith of Amash, by this route.