كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(83)
Chapter: The sickness of the Prophet (saws) and his death
(83)
بَابُ مَرَضِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَوَفَاتِهِ
Sahih al-Bukhari 4437

Narrated Aisha:

When Allah 's Apostle was in good health, he used to say, "Never does a prophet die unless he is shown his place in Paradise ( before his death ), and then he is made alive or given option." When the Prophet became ill and his last moments came while his head was on my thigh, he became unconscious, and when he came to his senses, he looked towards the roof of the house and then said, "O Allah! (Please let me be) with the highest companion." Thereupon I said, "Hence he is not going to stay with us? " Then I came to know that his state was the confirmation of the narration he used to mention to us while he was in good health.

حَدَّثَنَا أَبُو الْيَمَانِ، أَخْبَرَنَا شُعَيْبٌ، عَنِ الزُّهْرِيِّ، قَالَ عُرْوَةُ بْنُ الزُّبَيْرِ إِنَّ عَائِشَةَ قَالَتْ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم وَهْوَ صَحِيحٌ يَقُولُ ‏"‏ إِنَّهُ لَمْ يُقْبَضْ نَبِيٌّ قَطُّ حَتَّى يَرَى مَقْعَدَهُ مِنَ الْجَنَّةِ ثُمَّ يُحَيَّا أَوْ يُخَيَّرَ ‏"‏‏.‏ فَلَمَّا اشْتَكَى وَحَضَرَهُ الْقَبْضُ وَرَأْسُهُ عَلَى فَخِذِ عَائِشَةَ غُشِيَ عَلَيْهِ، فَلَمَّا أَفَاقَ شَخَصَ بَصَرُهُ نَحْوَ سَقْفِ الْبَيْتِ ثُمَّ قَالَ ‏"‏ اللَّهُمَّ فِي الرَّفِيقِ الأَعْلَى ‏"‏‏.‏ فَقُلْتُ إِذًا لاَ يُجَاوِرُنَا‏.‏ فَعَرَفْتُ أَنَّهُ حَدِيثُهُ الَّذِي كَانَ يُحَدِّثُنَا وَهْوَ صَحِيحٌ‏.‏
Reference : Sahih al-Bukhari 4437
In-book reference : Book 64, Hadith 458
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 721
  (deprecated numbering scheme)