Sunan Abi Dawud, Book 40, Hadith 89 (Abu Dawud 4441)

Jabir said:

A man committed fornication with a woman. It was not known that he was married. So he was flogged. It was then known that he was married, so he was stoned to death.