Surah An-Nisa, ayah 15

4:15

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

Wallātī ya'tīnal-fāhishata min nisā'ikum fastashhidū 'alayhinna arba'atam minkum fa in shahidū fa amsikūhunna fil-buyūti hattā yatawaffāhunnal-mawtu aw yaj'alallāhu lahunna sabīlā

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

Footnotes

169 The witnesses must swear to actually having seen the act taking place.

170 The "other way" (i.e., penalty) was later revealed in 24:2, canceling the ruling in this verse.