I believe you've read the hadith about Khorasan wars. And most probably you've read about the hadith on the phases of Muslims ruling era? "There will be Prophethood for as long as Allah wills it to be, then He will remove it when He wills, then there will be Khilafah on the Prophetic method and it will be for as long as Allah wills, then He will remove it when He wills, then there will be biting Kingship for as long as Allah Wills, then He will remove it when He wills, then there will be oppressive kingship for as long as Allah wills, then he will remove it when He wills, and then there will be Khilafah upon the Prophetic method" and then he remained silent.