Like all the other laws in Islam, the penal laws, too, were revealed step by step. House arrest was prescribed as the punishment for adultery in the beginning. 'If any of your women are guilty of lewdness, take the evidence of four (reliable) witnesses from amongst you against them; and if they testify, confine them to houses until death do claim them, or Allah ordain for them some (other) way.' (Qur'an 4:15)
The reference here to the statement '....until Allah provides for them another way' was later on rendered irrelevant with the final prescription of the punishment for adultery. This went as follows: 'The woman and the man guilty of fornication, flog each of them with a hundred stripes: let not compassion move you in their case, in a matter prescribed by Allah, if ye believe in Allah and the Last Day: and let a party of the believers witness their punishment.' (Qur'an 24:2)
The one hundred lashes prescribed in this verse is meant for the unmarried adulterers. If they are married the Islamic law is to kill them by stoning. It is evident that the Prophet had, during his rule, prescribed stoning to death in four such cases. Out of these, the culprits in one case were Jewish. The other three cases involved Muslims alone. The command to kill adulterer by stoning is reported by almost all books of Hadith (Muslim, Abu Davood, Ibn Majah, Baihaqi, Ahmad). Thus there is no difference of opinion amongst Muslim scholars over the issue that married adulterers must be stoned to death. This is so even without such a punishment being mentioned in the Qur'an because it has been confirmed by the Hadith which are of a genuine, and accepted, nature.