Sahih Muslim 2444 e
'A'isha, the wife of Allah's Apostle (ﷺ), reported that he used to say:
Never a prophet dies in a state that he is not made to see his abode in Paradise, and then given a choice. 'A'isha said that when Allah's Messenger (ﷺ) was about to leave the world, his head was over her thigh and he had fallen into swoon three times. When he felt relief his eyes were fixed at the ceiling. He then said: O Allah, along with the high companions (i. e. along with the Apostles who live in the most elevated place of the Paradise). (On hearing these words), I then said (to myself) He is not going to opt us and I remembered a hadith which he had narrated to us as he was healthy and in which he said: No prophet dies until he sees his abode in Paradise, he is then given a choice. 'A'isha said: These were the last words which Allah's Messenger (ﷺ) spoke (the words are): O Allah, with companions on High.
حَدَّثَنِي عَبْدُ الْمَلِكِ بْنُ شُعَيْبِ بْنِ اللَّيْثِ بْنِ سَعْدٍ، حَدَّثَنِي أَبِي، عَنْ جَدِّي، حَدَّثَنِي 
 عُقَيْلُ بْنُ خَالِدٍ، قَالَ قَالَ ابْنُ شِهَابٍ أَخْبَرَنِي سَعِيدُ بْنُ الْمُسَيَّبِ، وَعُرْوَةُ بْنُ الزُّبَيْرِ، فِي رِجَالٍ
 مِنْ أَهْلِ الْعِلْمِ أَنَّ عَائِشَةَ زَوْجَ النَّبِيِّ صلى الله عليه وسلم قَالَتْ كَانَ رَسُولُ اللَّهِ صلى
 الله عليه وسلم يَقُولُ وَهُوَ صَحِيحٌ ‏"‏ إِنَّهُ لَمْ يُقْبَضْ نَبِيٌّ قَطُّ حَتَّى يَرَى مَقْعَدَهُ فِي الْجَنَّةِ
 ثُمَّ يُخَيَّرُ ‏"‏ ‏.‏ قَالَتْ عَائِشَةُ فَلَمَّا نَزَلَ بِرَسُولِ اللَّهِ صلى الله عليه وسلم وَرَأْسُهُ عَلَى فَخِذِي
 غُشِيَ عَلَيْهِ سَاعَةً ثُمَّ أَفَاقَ فَأَشْخَصَ بَصَرَهُ إِلَى السَّقْفِ ثُمَّ قَالَ ‏"‏ اللَّهُمَّ الرَّفِيقَ الأَعْلَى
 ‏"‏ ‏.‏ قَالَتْ عَائِشَةُ قُلْتُ إِذًا لاَ يَخْتَارُنَا ‏.‏ قَالَتْ عَائِشَةُ وَعَرَفْتُ الْحَدِيثَ الَّذِي كَانَ يُحَدِّثُنَا
 بِهِ وَهُوَ صَحِيحٌ فِي قَوْلِهِ ‏"‏ إِنَّهُ لَمْ يُقْبَضْ نَبِيٌّ قَطُّ حَتَّى يَرَى مَقْعَدَهُ مِنَ الْجَنَّةِ ثُمَّ يُخَيَّرُ
 ‏"‏ ‏.‏ قَالَتْ عَائِشَةُ فَكَانَتْ تِلْكَ آخِرُ كَلِمَةٍ تَكَلَّمَ بِهَا رَسُولُ اللَّهِ صلى الله عليه وسلم قَوْلَهُ
 ‏"‏ اللَّهُمَّ الرَّفِيقَ الأَعْلَى ‏"‏ ‏.‏