Sayyiduna Abu Mas’ud (may Allah be pleased with him), in the explanation of this Divine statement: ﴿وَالْمُحْصَنَاتُمِنَالنِّسَاءِإِلَّامَامَلَكَتْأَيْمَانُكُمْ﴾[سورة النساء : 24] “And (forbidden to you are) married women except those whom your right hands possess,” says that these women were married, their husbands were present before they were taken captive in war, but when they became slave women, then (after ensuring they are not pregnant) it is lawful for Muslims to marry or have intercourse with them.
Hadith Referenceالسنن المأثورة / باب أيام التشريق / 394
Hadith Takhrijالسنن الكبرى للبيهقي : 167/7، تفسير الطبري : 158,155/8۔