لَنْ تَنَالُوا 164 النِّســاء

وَاللَّاتِي يَأْتِينَ الْفَاحِشَةَ مِنْ نِسَائِكُمْ فَاسْتَشْهِدُوا عَلَيْهِنَّ أَرْبَعَةً مِنْكُمْ فَإِنْ شَهِدُوا فَأَمْسِكُوهُنَّ فِي الْبُيُوتِ حَتَّى يَتَوَفَّاهُنَّ الْمَوْتُ أَوْ يَجْعَلَ اللَّهُ لَهُنَّ سَبِيلًا ﴿۱۵﴾ وَاللَّذَانِ يَأْتِيَانِهَا مِنْكُمْ فَآذُوهُمَا فَإِنْ تَابَا وَأَصْلَحَا فَأَعْرِضُوا عَنْهُمَا إِنَّ اللَّهَ كَانَ تَوَّابًا رَحِيمًا ﴿۱۶﴾ إِنَّمَا التَّوْبَةُ عَلَى اللَّهِ لِلَّذِينَ يَعْمَلُونَ السُّوءَ بِجَهَالَةٍ ثُمَّ يَتُوبُونَ مِنْ قَرِيبٍ فَأُولَئِكَ يَتُوبُ اللَّهُ عَلَيْهِمْ وَكَانَ اللَّهُ عَلِيمًا حَكِيمًا ﴿۱۷﴾

﴾15﴿ Wallaatee ya'teenal faahishata min nisaaa'ikum fastash-hidoo 'alaihinna arba'atam minkum fa in shahidoo fa amsikoohunna fil buyooti hatta yatawaffaa hunnal mawtu aw yaj'alal laahu lahunna sabeelaa
﴾16﴿ Wallazaani ya'tiyaanihaa minkum fa aazoohumaa fa in taabaa wa aslahaa fa a'ridoo 'anhumaaa; innal laaha kaana Tawwaabar Raheema
﴾17﴿ Innamat tawbatu 'alallaahi lillazeena ya'maloonas sooo'a bijahaalatin summa yatooboona min qareebin fa ulaa'ika yatoobul laahu 'alaihim; wa kaanal laahu 'Aleeman Hakeemaa

﴾15﴿ And those women among you who commit indecency—seek witnesses against them from among you, four men. If they testify, then confine those women to their houses until death overtakes them or Allah makes for them a way (out).
﴾16﴿ And those two among you who commit indecency—then harm them (with a reprimand or punishment). But if they repent and do righteous deeds, then turn away from them (i.e., stop harming them). Indeed, Allah is the Accepter of repentance, Most Merciful.
﴾17﴿ Repentance is accepted by Allah only for those who do evil in ignorance, then repent soon after; it is they to whom Allah turns in mercy, and Allah is All-Knowing, All-Wise.

[15] This is the eighth ruling: confining women who commit indecency. The purpose here is to protect women and their chastity. In this verse, only confinement to the house is mentioned as a means of protection from immorality—the rulings of flogging or stoning were to come later, so this is not considered abrogated. The use of the word "arba‘ata" (four, with a feminine ending) indicates that the witnesses to prove adultery must be men, as in Arabic grammar, the number for masculine nouns takes the feminine ending. (يَجْعَلَ اللَّهُ لَهُنَّ سَبِيلًا) refers to the legal punishment for adultery: for an unmarried woman, it is one hundred lashes and one year of exile; for a married woman, it is stoning, as mentioned in authentic hadith.
[16] Repentance is only accepted by Allah for those who do evil out of ignorance, then repent soon after. It is such people whose repentance Allah accepts, and Allah is All-Knowing, All-Wise.
[17] This is encouragement to repent within its due time; its due time is before death, which is why "soon after" is mentioned.
"As a result of ignorance" means that every wrongdoer, even if knowledgeable, is ignorant at the time of committing the sin, because they are unaware of its consequences.