Sunan Abi Dawud Book 42, Hadith 51
The Prophet (ﷺ) said: The Caliphate of Prophecy will last thirty years; then Allah will give the Kingdom of His Kingdom to anyone He wills.
Sa'id told that Safinah said to him: Calculate Abu Bakr's caliphate as two years, 'Umar's as ten, 'Uthman's as twelve and 'Ali so and so. Sa'id said: I said to Safinah: They conceive that 'Ali was not a caliph. He replied: The buttocks of Marwan told a lie.
I prayed the Friday prayer with al-Hajjaj and he addressed. He then transmitted the tradition of Abu Bakr b. ‘Ayyash. He said in it: Hear and obey the caliph of Allah and his select ‘Abd al-Malik bin Marwan. He then transmitted the rest of the tradition, and said: If I seized Rabi’ah for Mudar. But he did not mention the story of the clients (i.e. non Arabs).
The caliphate of Prophecy will last thirty years; then Allah will give the Kingdom to whom he wishes; or his kingdom to whom he wishes.