“Allah accepts the repentance of His slave so long as the death rattle has not yet reached his throat.”
Sunan Ibn Majah Book 37, Hadith 154