Surah An-Nisaa

4:15

وَٱلَّٰتِى يَأْتِينَ ٱلْفَٰحِشَةَ مِن نِّسَآئِكُمْ فَٱسْتَشْهِدُوا۟ عَلَيْهِنَّ أَرْبَعَةًۭ مِّنكُمْ ۖ فَإِن شَهِدُوا۟ فَأَمْسِكُوهُنَّ فِى ٱلْبُيُوتِ حَتَّىٰ يَتَوَفَّىٰهُنَّ ٱلْمَوْتُ أَوْ يَجْعَلَ ٱللَّهُ لَهُنَّ سَبِيلًۭا

Those who commit unlawful sexual intercourse of your women - bring against them four [witnesses] from among you. And if they testify, confine the guilty women to houses until death takes them or Allah ordains for them [another] way.

Tafsir 4:15

For those of your women who commit sexual offences – whether they are married or unmarried – call four trustworthy Muslim men witnesses. If they bear witness against them, then confine them to their homes as a punishment, until the end of their lives, or until Allah makes a way for them other than being confined. The ruling of this verse was replaced with the ruling that unmarried women who have illicit sexual relations should be whipped a hundred times and banished for a year, and married women who have illicit sexual relations should be stoned.