The appearance of the Mahdi Sunan Ibn Majah 4084

Arabic hadith text
حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى، وَأَحْمَدُ بْنُ يُوسُفَ، قَالاَ حَدَّثَنَا عَبْدُ الرَّزَّاقِ، عَنْ سُفْيَانَ الثَّوْرِيِّ، عَنْ خَالِدٍ الْحَذَّاءِ، عَنْ أَبِي قِلاَبَةَ، عَنْ أَبِي أَسْمَاءَ الرَّحَبِيِّ، عَنْ ثَوْبَانَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ ‏"‏ يَقْتَتِلُ عِنْدَ كَنْزِكُمْ ثَلاَثَةٌ كُلُّهُمُ ابْنُ خَلِيفَةٍ ثُمَّ لاَ يَصِيرُ إِلَى وَاحِدٍ مِنْهُمْ ثُمَّ تَطْلُعُ الرَّايَاتُ السُّودُ مِنْ قِبَلِ الْمَشْرِقِ فَيَقْتُلُونَكُمْ قَتْلاً لَمْ يُقْتَلْهُ قَوْمٌ ‏"‏ ‏.‏ ثُمَّ ذَكَرَ شَيْئًا لاَ أَحْفَظُهُ فَقَالَ ‏"‏ فَإِذَا رَأَيْتُمُوهُ فَبَايِعُوهُ وَلَوْ حَبْوًا عَلَى الثَّلْجِ فَإِنَّهُ خَلِيفَةُ اللَّهِ الْمَهْدِيُّ ‏"
Translation
It was narrated from Thawban that the Messenger of Allah (ﷺ) said

"Three will fight one another for your treasure, each one ofthem theson of a caliph, but none of them will gain it. Then theblack bannerswill come from the east, and they will kill you in anunprecedentedmanner." Then he mentioned something that I do notremember, then hesaid: "When you see them, then pledge yourallegiance to them even ifyou have to crawl over the snow, for thatis the caliph of Allah,Mahdi."