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.
عَنِ النَّبِيِّ ﷺ فِي الرَّجُلِ يَأْتِي جَارِيَةَ امْرَأَتِهِ قَالَ إِنْ كَانَتْ أَحَلَّتْهَا لَهُ جُلِدَ مِائَةً وَإِنْ لَمْ تَكُنْ أَحَلَّتْهَا لَهُ رَجَمْتُهُ