Sunan an-Nasa'i, Volume 4, Book 26, Hadith 3365 (DarusSalam)

It was narrated that Salamah bin Al-Muhabbaq said: "The Prophet passed judgment concerning a man who had intercourse with his wife's slave woman: 'If he forced her, then she is free, and he has to give her mistress a similar slave as a replacement; if she obeyed him in that, then she belongs to him, and he has to give her mistress a similar slave as a replacement.'"

أَخْبَرَنَا مُحَمَّدُ بْنُ رَافِعٍ، قَالَ حَدَّثَنَا عَبْدُ الرَّزَّاقِ، قَالَ حَدَّثَنَا مَعْمَرٌ، عَنْ قَتَادَةَ، عَنِ الْحَسَنِ، عَنْ قَبِيصَةَ بْنِ حُرَيْثٍ، عَنْ سَلَمَةَ بْنِ الْمُحَبَّقِ، قَالَ قَضَى النَّبِيُّ صلى الله عليه وسلم فِي رَجُلٍ وَطِئَ جَارِيَةَ امْرَأَتِهِ ‏ "‏ إِنْ كَانَ اسْتَكْرَهَهَا فَهِيَ حُرَّةٌ وَعَلَيْهِ لِسَيِّدَتِهَا مِثْلُهَا وَإِنْ كَانَتْ طَاوَعَتْهُ فَهِيَ لَهُ وَعَلَيْهِ لِسَيِّدَتِهَا مِثْلُهَا ‏" ‏ ‏.‏

sunnah.com