كتاب المغازى
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 4440

Narrated `Aisha:

I heard the Prophet (ﷺ) and listened to him before his death while he was leaning his back on me and saying, "O Allah! Forgive me, and bestow Your Mercy on me, and let me meet the (highest) companions (of the Hereafter)."

(See the Qur'an (4:69) and Hadith #4435)

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