The Prophet (ﷺ) said: about a man who had (unlawful) intercourse with his wife's slave girl: If she made her lawful for him, he will be flogged one hundred lashes; if she did not make her lawful for him, I shall stone him.
Sunan Abi Dawud Book 40, Hadith 109