The Midian War documented in the Hebrew Bible, Numbers 31, was intended to exterminate the Midianites, who had "led the people of Israel to sin against God". (However, some Midianites survived well into the days of the Book of Judges.) Moses commanded one thousand males from each of the twelve tribes of Israel to destroy the cities and the warriors of Midian. The "false prophet" Balaam was killed, along with the five Midianite kings.
Only the Midianite women and children were left alive, but Moses was still not satisfied. Because they had "caused the children of Israel, through the counsel of Balaam," to sin against the Lord and had sent a plague into the congregation of Israelites, Moses decreed that every male child and non-virginal woman be killed (since it was the Midianite women who led the Israelite men into sexual sin). The Midianite virgins were taken by the Israelites as part of the spoils of war.
After they finished the Midianite extermination, the Israelites involved in killing the enemy (or had come in contact with any of the corpses or even any tool or weapon that had come into contact with a dead person) were instructed to stay outside of the camp (i.e. community) for seven days. While outside the camp, on the third and seventh days, ritual purification occurred (high priest sprinkling water mixed with ashes of the red heifer onto the people as required by the instructions to Israel in Numbers 19:11-20).
According to the high priest Eleazar, the Lord instructed Moses to divide the spoils of war equally between the warriors and the entire congregation of Israelites. After this division was made, the military officers offered thousands of shekels worth of jewelry to the Lord as an atonement for their killing of the Midianites.
- Daniel Chirot, Clark McCauley (2010). Why Not Kill Them All?: The Logic and Prevention of Mass Political Murder. Princeton University Press. pp. 29–30, 38–39. ISBN 0691145946.