The LORD spoke to Moses:
Take just reparations for the Israelites from the Midianites. Afterward you will join your ancestors.
Moses spoke to the people: "Equip some of your men for battle so that they may go against Midian and execute the LORD's just punishment against Midian.
You will send out for battle one thousand from each of the tribes of Israel."
From the thousands of Israel, one thousand from each tribe were selected. Twelve thousand were equipped for battle.
Moses sent them to battle, one thousand from each tribe, along with Phinehas, Eleazar the priest's son, who carried the sanctuary equipment and the trumpets for sounding the alarm in his hand.
They battled against Midian as the LORD had commanded Moses, and they killed every male.
They killed the kings of Midian: Evi, Rekem, Zur, Hur, and Reba, the five kings of Midian, along with others slain. They also killed Balaam, Beor's son, with the sword.
The Israelites took captive the Midianite women, their little ones, all their cattle, their herds, and their possessions.
They burned all the cities where they lived and their encampments.
They took all the spoils of war and the valuable property, both human and animal,
and they brought the captives, the valuable property, and the spoils of war to Moses, Eleazar the priest, and the Israelite community, at the camp on the plains of Moab by the Jordan across from Jericho.
Moses, Eleazar the priest, and the chiefs of the community went to meet them outside the camp.
Moses became angry with the commanders of the army, the officers of thousands and the officers of hundreds, who came back from the battle.
Moses said to them, "Have you let all the women live?
These very women, on Balaam's advice, made the Israelites break faith with the LORD in the affair at Peor, so there was a plague among the LORD's community.
Now kill every male child and every female who has known a man intimately by sleeping with him.
But all the young girls who have not known a man intimately by sleeping with him, spare for yourselves.
You will remain outside the camp for seven days. Everyone among you or your captives who has killed a person or touched a corpse must purify themselves on the third and seventh days.
You must also purify every garment, and everything made of leather, goats' hair, or wood."
Eleazar the priest said to the men of battle who had gone out to war, "This is the regulation in the Instruction that the LORD commanded Moses:
Gold, silver, copper, iron, tin, and lead—
anything that can withstand fire—you will put through the fire and it will be clean. It will also be purified with the water of purification. Anything that isn't able to withstand fire, you will immerse in water.
You must wash your clothes on the seventh day and you will be clean. Afterward you may enter the camp."
The LORD said to Moses:
You, Eleazar the priest, and the leaders of the community's households must take an inventory of the valuable property and the captives, both human and animals,
and divide the valuable property between the warriors who went into battle and the entire community.
You will offer as tribute to the LORD from each warrior who went into battle one living being in five hundred, whether human, oxen, donkeys, or flocks.
Take it from the warriors' half and give it to Eleazar the priest as a gift offering to the LORD.
But from the Israelites' half you will take one out of every fifty, whether from human, oxen, donkeys, or flock—all the animals. You will give them to the Levites who carry out the duties of the LORD's dwelling.
Moses and Eleazar the priest did as the LORD commanded Moses.
The valuable property remaining from the spoils of war that the people of the army had taken was 675,000 sheep,
and 32,000 women who hadn't known a man intimately by sleeping with him.
The half-share of those who had gone out to battle numbered 337,500 sheep,
of which the LORD's tribute was 675.
The oxen were 36,000, of which the LORD's tribute was 72.
The donkeys were 30,500, of which the LORD's tribute was 61.
Humans were 16,000, of which the LORD's tribute was 32 persons.
Moses gave the tribute, a gift offering for the LORD, to Eleazar the priest as the LORD had commanded Moses.
As for the half-share of the Israelites that Moses divided from those who had gone out to battle:
the community's half-share was 337,500 sheep,
and 16,000 humans.
Moses took from the Israelites' half one out of every fifty, from humans and animals. He gave them to the Levites who carry out the duties of the LORD's dwelling, just as the LORD had commanded Moses.
The commanders over the thousands of the army, officers over thousands and officers over hundreds, approached Moses
and said to Moses, "Your servants have counted the warriors in our charge and not one of us is missing.
We have brought the LORD's offering that each found, gold articles—anklets, bracelets, signet rings, earrings, and necklaces—to seek reconciliation for ourselves before the LORD."
Moses and Eleazar the priest took all the gold articles from them.
All the gold for the gift offering that was presented to the LORD from the officers of thousands and the officers of hundreds was sixteen thousand seven hundred fifty shekels.
Each of the men of battle took spoils of war for himself.
Yet Moses and Eleazar the priest also received the gold from the officers of thousands and of hundreds, and they brought it to the meeting tent as a memorial for the Israelites before the LORD.