Surah An-Nur 24:8
وَيَدْرَؤُا۟ عَنْهَا ٱلْعَذَابَ أَن تَشْهَدَ أَرْبَعَ شَهَـٰدَٰتٍۭ بِٱللَّهِ ۙ إِنَّهُۥ لَمِنَ ٱلْكَـٰذِبِينَ
But it will prevent punishment from her if she gives four testimonies [swearing] by Allāh that indeed, he is of the liars.
Translation: Saheeh International
Tafsir
And the punishment namely the prescribed legal punishment for fornication that is established upon his testimony shall be averted from her if she testify swearing by God four times that he is indeed lying in accusing her of having fornicated;
Excerpt from Tafsir al-Jalalayn, commentary on 24:8, via Quran.com. The reader has the full commentary and 9 more tafsirs.