The Prophet ﷺ said, "Allah accepts the repentance of a servant as long as the death rattle has not reached his throat."
حدثنا راشد بن سعيد الرملي أنبأنا الوليد بن مسلم عن ابن ثوبان عن أبيه عن مكحول عن جبير بن نفير
عن النبي ﷺ قال إن الله عز وجل ليقبل توبة العبد ما لم يغرغر
Tirmidhi narrated it in Supplications, chapter 1, Allah accepts the repentance of a slave as long as he has not begun the death rattle, hadith 3537, from the hadith of Ibn Thawban, with this wording, and he said it is hasan, rare. Ibn Hibban graded it sahih, hadith 2449, as did Hakim (257/4) and Dhahabi. Baghawi graded it hasan in Sharh al-Sunnah (90/5), hadith 1306.The hadith has supporting narrations in Ibn Hibban, hadith 2450, and elsewhere.