What he said while Aisha held his hand
She was rubbing his hand with it while he was dying.
اللَّهُمَّ اغْفِرْ لِي وَاجْعَلْنِي مَعَ الرَّفِيقِ الأَعْلَى
Allāhumma-ghfir lī wa-rḥamnī wa alḥiqnī bi-r-rafīqi-l-aʿlā.
“O Allah, forgive me and have mercy on me, and join me with the highest Companion.”
The full narration
A'isha reported:When any person amongst us fell ill, Allah's Messenger (may peace he upon him) used to rub him with his right band and then say: O Lord of the people, grant him health, heal him, for Thou art a Greet Healer. There is no healere, but with Thy healing Power one is healed and illness is removed. She further added: When Allah's Messenger (ﷺ) fell ill, and his illness took a serious turn I took hold of hie hand to that I should do with it what he ward to do with that (i. e. I would rub his body with his sacred hand). But he withdrew his hand from my hand and then said: O Allah, pardon me and make me join the companion. ship on She said. I was gazing at him constantly whereas he had passed away
Source
Ṣaḥīḥ Muslim · 5707
- Agreed upon as authentic (al-Bukhārī / Muslim)