Abu Darda reported,

The Messenger of Allah ﷺ was on a military expedition when he saw a pregnant captive woman. He asked, "Perhaps her master has had relations with her?"They replied, "Yes."He said, "I was about to curse him with a curse that would enter the grave with him. How can he claim him as his heir when the child is not lawful to him? And how can he make use of him as a slave when he is not lawful to him?"

Abu Dawud 2156

Sahih

حدثنا النفيلي حدثنا مسكين حدثنا شعبة عن يزيد بن خمير عن عبد الرحمن بن جبير بن نفير عن أبيه

عن أبي الدرداء

أن رسول الله ﷺ كان في غزوة فرأى امرأة مجحا فقال لعل صاحبها ألم بها قالوا نعم فقال لقد هممت أن ألعنه لعنة تدخل معه في قبره كيف يورثه وهو لا يحل له وكيف يستخدمه وهو لا يحل له

أبو داود 2156صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Marriage
Chapter
Intercourse with captives
Numbering
Darussalam 2156
Abu Dawud 2156