The Messenger of Allah ﷺ said, "Three will fight one another at your treasure, each of them a son of a caliph, yet none of them will gain it. Then the black banners will appear from the direction of the east, and they will slaughter you with a slaughter unlike any people have ever inflicted."Then he mentioned something I do not remember, and said, "When you see him, pledge allegiance to him, even if you must crawl over the snow, for he is the Caliph of Allah, the Mahdi."
حدثنا محمد بن يحيى وأحمد بن يوسف قالا حدثنا عبد الرزاق عن سفيان الثوري عن خالد الحذاء عن أبي قلابة عن أبي أسماء الرحبي
قال رسول الله ﷺ يقتتل عند كنزكم ثلاثة كلهم ابن خليفة ثم لا يصير إلى واحد منهم ثم تطلع الرايات السود من قبل المشرق فيقتلونكم قتلا لم يقتله قوم ثم ذكر شيئا لا أحفظه فقال فإذا رأيتموه فبايعوه ولو حبوا على الثلج فإنه خليفة الله المهدي
No references are available.
[Its chain of transmission is daif] Bayhaqi transmitted it in Dalail (6/515) from the hadith of Abdul-Razzaq through the same route. Busiri graded it sahih, as did Hakim (4/463, 464, 502) according to the standard of the two Shaykhs, and Dhahabi agreed with him. Ibn Kathir also graded it sahih. But its chain is daif because of Thawri's use of "an" in transmission (indicating a possible break in the chain), hadith no. 162. Part of the hadith has supporting evidence from other narrations.