On the day of Hunayn, the Messenger of Allah ﷺ dispatched an army to Awtas. They met an enemy force, fought them, defeated them, and captured women as prisoners. Some of the companions of the Messenger of Allah ﷺ felt uneasy about having relations with these women because they had husbands among the polytheists. So Allah revealed concerning this, "And women already married, except those whom your right hands possess" [Nisa 4:24], meaning they are lawful for you once their waiting period has ended.
أن رسول الله ﷺ يوم حنين بعث جيشا إلى أوطاس، فلقوا عدوا، فقاتلوهم، فظهروا عليهم، وأصابوا لهم سبايا، فكأن ناسا من أصحاب رسول الله ﷺ تحرجوا من غشيانهن من أجل أزواجهن من المشركين، فأنزل الله عز وجل في ذلك: {والمحصنات من النساء إلا ما ملكت أيمنكم} أي: فهن لكم حلال إذا انقضت عدتهن.
Muslim narrated it in the Book of Suckling (1456:33) from Ubaydullah bin Umar bin Maysara al-Qawariri, who said, Yazid bin Zuray told us, Saeed bin Abu Aruba told us, from Qatada, from Salih Abu Khalil, from Abu Alqama al-Hashimi, from Abu Saeed Khudri, who said, and then he mentioned it.