When Messenger of Allah ﷺ was healthy, he used to say, "No prophet dies till he is shown his place in Paradise, and then he is given the option (to live or die)." So when death approached him(during his illness), and while his head was on my thigh, he became unconscious for a while, and when he recovered, he fixed his eyes on the ceiling and said, "O Allah! (Let me join) the Highest Companions (see Qur'an 4:69)," I said, "So, he does not choose us." Then I realized that it was the application of the statement he used to relate to us when he was healthy. So that was his last utterance (before he died), i.e. "O Allah! (Let me join) the Highest Companions."
كَانَ رَسُولُ اللَّهِ ﷺ يَقُولُ وَهْوَ صَحِيحٌ لَنْ يُقْبَضَ نَبِيٌّ قَطُّ حَتَّى يَرَى مَقْعَدَهُ مِنَ الْجَنَّةِ ثُمَّ يُخَيَّرُ فَلَمَّا نَزَلَ بِهِ وَرَأْسُهُ عَلَى فَخِذِي غُشِيَ عَلَيْهِ سَاعَةً ثُمَّ أَفَاقَ فَأَشْخَصَ بَصَرَهُ إِلَى السَّقْفِ ثُمَّ قَالَ اللَّهُمَّ الرَّفِيقَ الأَعْلَى قُلْتُ إِذًا لاَ يَخْتَارُنَا وَعَلِمْتُ أَنَّهُ الْحَدِيثُ الَّذِي كَانَ يُحَدِّثُنَا وَهْوَ صَحِيحٌ قَالَتْ فَكَانَتْ تِلْكَ آخِرَ كَلِمَةٍ تَكَلَّمَ بِهَا اللَّهُمَّ الرَّفِيقَ الأَعْلَى