حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى، وَأَحْمَدُ بْنُ يُوسُفَ، قَالاَ حَدَّثَنَا عَبْدُ الرَّزَّاقِ، عَنْ سُفْيَانَ الثَّوْرِيِّ، عَنْ خَالِدٍ الْحَذَّاءِ، عَنْ أَبِي قِلاَبَةَ، عَنْ أَبِي أَسْمَاءَ الرَّحَبِيِّ، عَنْ ثَوْبَانَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ ‏"‏ يَقْتَتِلُ عِنْدَ كَنْزِكُمْ ثَلاَثَةٌ كُلُّهُمُ ابْنُ خَلِيفَةٍ ثُمَّ لاَ يَصِيرُ إِلَى وَاحِدٍ مِنْهُمْ ثُمَّ تَطْلُعُ الرَّايَاتُ السُّودُ مِنْ قِبَلِ الْمَشْرِقِ فَيَقْتُلُونَكُمْ قَتْلاً لَمْ يُقْتَلْهُ قَوْمٌ ‏"‏ ‏.‏ ثُمَّ ذَكَرَ شَيْئًا لاَ أَحْفَظُهُ فَقَالَ ‏"‏ فَإِذَا رَأَيْتُمُوهُ فَبَايِعُوهُ وَلَوْ حَبْوًا عَلَى الثَّلْجِ فَإِنَّهُ خَلِيفَةُ اللَّهِ الْمَهْدِيُّ ‏"‏ ‏.‏

It was narrated from Thawban that the Messenger of Allah (PBUH) 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." Translation Not Available

Book Ref: Sunan Ibn Majah Book 36 Hadith 4084
Web Ref:  Sunan Ibn Majah Vol 5 Book 36 Hadith 4084