The Prophet ﷺ gave a ruling concerning a man who had relations with his wife's slave girl. If he had forced her, she became free, and he owed her mistress a slave girl of equal value. If she had consented, she became his, and he still owed her mistress a slave girl of equal value.
أخبرنا محمد بن رافع قال حدثنا عبد الرزاق قال حدثنا معمر عن قتادة عن الحسن عن قبيصة بن حريث
قضى النبي ﷺ في رجل وطئ جارية امرأته إن كان استكرهها فهي حرة وعليه لسيدتها مثلها وإن كانت طاوعته فهي له وعليه لسيدتها مثلها
[Its isnad is hasan] Abu Dawud narrated it in the Book of Legal Punishments, chapter on a man who commits fornication with his wife's slave girl, no. 4460, from the hadith of Abdul-Razzaq through this route. Hasan Basri stated clearly that he heard it directly, as recorded by Bayhaqi (8/240), and Qabisa is trustworthy and truthful, and no one has criticized him with any valid argument.