Sayyiduna Ibn Abbas (may Allah be pleased with them both), regarding the saying of Allah Almighty: "And those of your women who commit immorality" [Al-Nisa: 15] up to "until death takes them" [Al-Nisa: 15], said: "They used to be confined in the houses; if she died, she died, and if she lived, she lived." Until this verse of Surah al-Nur was revealed: "The fornicatress and the fornicator, flog each one of them with a hundred lashes," and Surah al-Hudud (the verses containing the rulings of the prescribed punishments) was revealed; so whoever committed any such act was flogged and then released.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11088