The Apostle of Allah (may peace be upon him) sent a military expedition to Awtas on the occasion of the battle of Hunain. They met their enemy and fought with them. They defeated them and took them captives.
Some of the Companions of the Apostle of Allah (may peace be upon him) were reluctant to have intercourse with the female captives in the presence of their husbands who were unbelievers. So Allah, the Exalted, sent down the Qur’anic verse: (Sura 4:24) "And all married women (are forbidden) unto you save those (captives) whom your right hands possess."
(Abu Dawud 2150)