Repentance is Accepted Until one Faces death
Allah
إِنَّمَا التَّوْبَةُ عَلَى اللّهِ لِلَّذِينَ يَعْمَلُونَ السُّوَءَ بِجَهَالَةٍ ثُمَّ يَتُوبُونَ مِن قَرِيبٍ
Allah accepts only the repentance of those who do evil in ignorance and foolishness, and repent soon (afterwards);
Allah states that He accepts repentance of the servant who commits an error in ignorance and then repents, even just before he sees the angel who captures the soul, before his soul reaches his throat.
Mujahid and others said,
"Every person who disobeys Allah by mistake, or intentionally is ignorant, until he refrains from the sin."
Qatadah said that Abu Al-Aliyah narrated that the Companions of the Messenger of Allah used to say,
"Every sin that the servant commits, he commits out of ignorance."
Abdur-Razzaq narrated that, Ma`mar said that Qatadah said that,
"the Companions of the Messenger of Allah agreed that every sin that is committed by intention or otherwise, is committed in ignorance."
Ibn Jurayj said,
"Abdullah bin Kathir narrated to me that Mujahid said, `Every person who disobeys Allah (even willfully), is ignorant while committing the act of disobedience."'
Ibn Jurayj said,
"Ata bin Abi Rabah told me something similar."
Abu Salih said that Ibn Abbas commented,
"It is because of one's ignorance that he commits the error."
Ali bin Abi Talhah reported that Ibn Abbas said about the Ayah,
ثُمَّ يَتُوبُونَ مِن قَرِيبٍ
(and repent soon (afterwards)),
"Until just before he (or she) looks at the angel of death."
Ad-Dahhak said,
"Every thing before death is `soon (afterwards)."'
Al-Hasan Al-Basri said about the Ayah,
ثُمَّ يَتُوبُونَ مِن قَرِيبٍ
(and repent soon afterwards),
"Just before his last breath leaves his throat."
Ikrimah said,
"All of this life is `soon (afterwards)."'
Imam Ahmad recorded that Ibn Umar said that the Messenger said,
إِنَّ اللهَ يَقْبَلُ تَوْبَةَ الْعَبْدِمَالَمْ يُغَرْغِر
Allah accepts the repentance of the servant as long as the soul does not reach the throat.
This Hadith was also collected by At-Tirmidhi and Ibn Majah, and At-Tirmidhi said, "Hasan Gharib".
By mistake, Ibn Majah mentioned that this Hadith was narrated through Abdullah bin `Amr. However, what is correct is that Abdullah bin Umar bin Al-Khattab was the narrator.
Allah said,
فَأُوْلَـيِكَ يَتُوبُ اللّهُ عَلَيْهِمْ وَكَانَ اللّهُ عَلِيماً حَكِيماً
It is they to whom Allah will forgive and Allah is Ever All-Knower, All-Wise.
Surely, when hope in continued living diminishes, the angel of death comes forth and the soul reaches the throat, approaches the chest and arrives at the state where it is being gradually pulled out, then there is no accepted repentance, nor a way out of that certain end.
Hence Allah's statements