[And the two who commit it among you], meaning: the indecency, [then punish them both] verbally, [then if they repent and amend themselves], the rest of the verse.
Then this verse was revealed: [And keep them in houses until death takes them or Allah ordains for them a way], meaning: an exit from confinement, according to the tafsir of al-Suddi. Then, there was revealed in Surah al-Nur: [The woman and the man guilty of adultery or fornication, flog each of them with a hundred stripes]. [Verse 17 - 18]
﴿والذان يأتيانها مِنْكُم﴾ يَعْنِي: الْفَاحِشَة ﴿فآذوهما﴾ بالألسنة ﴿فَإِن تابا وأصلحا﴾ الْآيَة.
ثمَّ نزلت هَذِه الْآيَة: ﴿فَأَمْسِكُوهُنَّ فِي الْبُيُوتِ حَتَّى يَتَوَفَّاهُنَّ الْمَوْتُ أَوْ يَجْعَلَ اللَّهُ لَهُنَّ سَبِيلا﴾ يَعْنِي: مخرجا من الْحَبْس؛ فِي تَفْسِير السّديّ، ثمَّ نزل فِي سُورَة النُّور: ﴿الزَّانِيَةُ وَالزَّانِي فَاجْلِدُوا كُلَّ وَاحِد مِنْهُمَا مائَة جلدَة﴾. [آيَة ١٧ - ١٨]