Numbers 31 "The Lord said to Moses, 2 “Take vengeance on the Midianites for the Israelites. After that, you will be gathered to your people.”
3 So Moses said to the people, “Arm some of your men to go to war against the Midianites so that they may carry out the Lord’s vengeance on them...7 They fought against Midian, as the Lord commanded Moses, and killed every man...9 The Israelites captured the Midianite women and children and took all the Midianite herds, flocks and goods as plunder. 10 They burned all the towns where the Midianites had settled, as well as all their camps. 11 They took all the plunder and spoils, including the people and animals, 12 and brought the captives, spoils and plunder to Moses and Eleazar...14 Moses was angry with the officers of the army—the commanders of thousands and commanders of hundreds—who returned from the battle.
15 “Have you allowed all the women to live?” he asked them. 16 “They were the ones who followed Balaam’s advice and enticed the Israelites to be unfaithful to the Lord in the Peor incident, so that a plague struck the Lord’s people. 17 Now kill all the boys. And kill every woman who has slept with a man, 18 but save for yourselves every girl who has never slept with a man."