وَٱلَّذَانِ يَأْتِيَـٰنِهَا مِنكُمْ فَـَٔاذُوهُمَا ۖ فَإِن تَابَا وَأَصْلَحَا فَأَعْرِضُوا۟ عَنْهُمَآ ۗ إِنَّ ٱللَّهَ كَانَ تَوَّابًا رَّحِيمًا
And the two1 who commit it [i.e., unlawful sexual intercourse] among you - punish [i.e., dishonor] them both. But if they repent and correct themselves, leave them alone. Indeed, Allāh is ever Accepting of Repentance and Merciful.
Dimensional Analysis
Context
If any of your women are guilty of lewdness, Take the evidence of four (Reliable) witnesses from amongst you against them; and if they testify, confine them to houses until death do claim them, or Allah ordain for them some (other) way.
If two men among you are guilty of lewdness, punish them both. If they repent and amend, Leave them alone; for Allah is Oft-returning, Most Merciful.
Allah accept the repentance of those who do evil in ignorance and repent soon afterwards; to them will Allah turn in mercy: For Allah is full of knowledge and wisdom.
Related Verses
واللهُ أعلمُ بالصَّواب