The Prophet ﷺ said, "Allah accepts the repentance of His servant as long as the death rattle has not reached his throat."
عن النبي ﷺ قال: إن الله يقبل توبة العبد ما لم يغرغر.
Tirmidhi (3537), Ibn Majah (4253), and Ahmad (6160) reported it, and Ibn Hibban (628) and Hakim (4/257) graded it sahih, all of them from the hadith of Ibn Thawban, from his father, from Makhul, from Jubayr bin Nufayr, from Ibn Umar, and he mentioned it. Except that in Sunan Ibn Majah it occurs as "from Abdullah bin Amr," which is a mistake, as Mizzi said in Tuhfah (5/328).Tirmidhi said, "Hasan gharib."I say, its chain is hasan because of Ibn Thawban, who is Abdul-Rahman bin Thabit bin Thawban Ansi Dimashqi. There is disagreement about him, but his hadith is hasan.