The Bible – Old Testament
1 While Israel was living at Shittim, the people degraded themselves by having illicit relations with the Moabite women.
These then invited the people to the sacrifices of their god, and the people ate of the sacrifices and worshiped their god.
When Israel thus submitted to the rites of Baal of Peor, the LORD’S anger flared up against Israel,
2 and he said to Moses, “Gather all the leaders of the people, and hold a public execution of the guilty ones before the LORD, that his blazing wrath may be turned away from Israel.”
So Moses told the Israelite judges, “Each of you shall kill those of his men who have submitted to the rites of Baal of Peor.”
3 Yet a certain Israelite came and brought in a Midianite woman to his clansmen in the view of Moses and of the whole Israelite community, while they were weeping at the entrance of the meeting tent.
When Phinehas, son of Eleazar, son of Aaron the priest, saw this, he left the assembly, and taking a lance in hand,
followed the Israelite into his retreat where he pierced the pair of them, the Israelite and the woman. Thus the slaughter of Israelites was checked;
but only after twenty-four thousand had died.
Then the LORD said to Moses,
4 “Phinehas, son of Eleazar, son of Aaron the priest, has turned my anger from the Israelites by his zeal for my honor among them; that is why I did not put an end to the Israelites for the offense to my honor.
Announce, therefore, that I hereby give him my pledge of friendship,
which shall be for him and for his descendants after him the pledge of an everlasting priesthood, because he was zealous on behalf of his God and thus made amends for the Israelites.”
5 The Israelite slain with the Midianite woman was Zimri, son of Salu, prince of an ancestral house of the Simeonites.
The slain Midianite woman was Cozbi, daughter of Zur, who was head of a clan, an ancestral house, in Midian.
6 The LORD then said to Moses,
“Treat the Midianites as enemies and crush them,
for they have been your enemies by their wily dealings with you as regards Peor and as regards their kinswoman Cozbi, the daughter of a Midianite prince, who was killed at the time of the slaughter because of Peor.”
After the slaughter7
1  Shittim: the full name was Abel-shittim, a locality at the foot of the mountains in the northeastern corner of the plains of Moab (⇒ Numbers 33:49). Illicit relations: perhaps as part of the licentious worship of Baal of Peor.
2  Hold a public execution: the same phrase occurs in ⇒ 2 Sam 21:6-14 where the context shows that at least a part of the penalty consisted in being denied honorable burial. In both passages, dismemberment as a punishment for the breaking of covenant pledges is a current understanding of the phrase.
3  Midianite woman: at this time the Midianites were leagued with the Moabites in opposing Israel; cf ⇒ Numbers 22:4, 7. Balaam had induced both the Midianites (⇒ Numbers 31:16) and the Moabites (⇒ Rev 2:14) to lure the Israelites to the obscene rites of Baal of Peor. They were weeping: on account of the plague that had struck them; cf ⇒ Numbers 25:8.
4  For my honor: by taking vengeance on those who had made Baal of Peor a rival of the Lord.
5 [14-15] The nobility of the slain couple is mentioned in order to stress the courage of Phinehas in punishing them. The zeal of Phinehas became proverbial; cf ⇒ Psalm 106:30; ⇒ Sirach 45:23; ⇒ 1 Macc 2:26, ⇒ 54.
6 [16-18] The account of the execution of this command is given in ⇒ Numbers 31:1-18.
7  This is the last verse of Numbers 25.