Sunan Ibn Majah, Book 37, Hadith 154 (Ibn Majah 4257)

It was narrated from ‘Abdullah bin ‘Amr that the Prophet (ﷺ) said:

“Allah accepts the repentance of His slave so long as the death rattle has not yet reached his throat.”