Hadithcore
Mishkat al-Masabih, 2343

Ibn ‘Umar reported God’s messenger as saying, “God accepts a servant’s repentance till he gives up his spirit in death.”* *The Arabic is <i>ma lam yugharghir</i>, which might, be translated literally "as long as he has not died with the death rattle in his throat." Tirmidhi and Ibn Majah transmitted it.

وَعَنِ ابْنِ عُمَرَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «إِنَّ اللَّهَ يَقْبَلُ تَوْبَةَ الْعَبْدِ مَا لَمْ يُغَرْغِرْ» . رَوَاهُ التِّرْمِذِيُّ وَابْن مَاجَه

References1 variant
In-Book Reference
Book 9, Hadith 116