The Messenger of Allah ﷺ dispatched an army to Awtas on the day of Hunayn. They met the enemy, fought them, and prevailed over them, taking captives. Some of the companions of the Messenger of Allah ﷺ felt uneasy about having relations with these captive women because they had husbands among the polytheists. So Allah revealed concerning this, "And married women, 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 Qawariri, who said, Yazid bin Zuray told us, Saeed bin Abu Aruba told us, from Qatada, from Salih Abu Khalil, from Abu Alqama Hashimi, from Abu Saeed Khudri, and he related it.Awtas is a valley between Taif and Hunayn. Hawazin fled there after their defeat, so the Prophet ﷺ sent Abu Amir Ashari against them, and he fought them. He was martyred after having appointed Abu Musa Ashari to succeed him, and Allah granted him victory.Ibn Ishaq said, When the polytheists were routed, they went to Taif, with Malik bin Awf among them. Some of them camped at Awtas, while others headed toward Nakhla. Sirat bin Hisham (2/453).