The Prophet ﷺ said, "Allah accepts the servant's tawba as long as the death rattle has not yet reached his throat."
حدثنا إبراهيم بن يعقوب حدثنا علي بن عياش الحمصي حدثنا عبد الرحمن بن ثابت بن ثوبان عن أبيه عن مكحول عن جبير بن نفير
عن النبي ﷺ قال إن الله يقبل توبة العبد ما لم يغرغر
HasanTakhrij: Ibn Majah also reported it in Zuhd, chapter on mentioning repentance, no. 4253, from the hadith of Abdul-Rahman bin Thabit through the same route. Ibn Hibban graded it sahih, no. 2449, as did Hakim, 4/257, and Dhahabi agreed with him. Baghawi graded it hasan. The hadith has corroborating narrations in Ibn Hibban, no. 4450, and elsewhere.