Dalil

Quran An-Nisa 4:16

وَٱلَّذَانِ يَأۡتِيَٰنِهَا مِنكُمۡ فَـَٔاذُوهُمَاۖ فَإِن تَابَا وَأَصۡلَحَا فَأَعۡرِضُواْ عَنۡهُمَآۗ إِنَّ ٱللَّهَ كَانَ تَوَّابٗا رَّحِيمًا

Translation

And the two 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.