Sunan Abi Dawud, Hadith 4635

Abu Bakrah said: One day the Prophet asked: Which of you had a dream? He then mentioned the rest of the tradition to the same effect, but he did not mention the word “disliked”. Instead, he said: The Messenger of Allah was grieved about that. He then said: There will be a caliphate on the model of prophecy, then Allah will give the kingdom to whom he wills.

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

sunnah.com

also referenced under: Hadith 4618 (Hasan)