While Israel was staying at Shittim, the men began to have sex with Moabite women
who invited the people to the sacrifices offered to their gods. The people ate the meat from the sacrifices and worshiped these gods.
Since the Israelites joined in worshiping the god Baal of Peor, the LORD became angry with Israel.
The LORD said to Moses, "Take all the leaders of the people, and execute them in broad daylight in the LORD's presence. This will turn the LORD's anger away from Israel."
So Moses said to the judges of Israel, "Each of you must kill the men who have joined in worshiping the god Baal of Peor."
One of the Israelite men brought a Midianite woman to his brothers. He did this right in front of Moses and the whole community of Israel while they were crying at the entrance to the tent of meeting.
Phinehas, son of Eleazar and grandson of the priest Aaron, saw this. So he left the assembly, took a spear in his hand,
and went into the tent after the Israelite man. He drove the spear through the man and into the woman's body. Because of this, the plague that the Israelites were experiencing stopped.
However, 24,000 people died from that plague.
Then the LORD said to Moses,
"Phinehas, son of Eleazar and grandson of the priest Aaron, turned my fury away from the Israelites. Since he stood up for me, I didn't have to stand up for myself and destroy them.
So tell Phinehas that I'm making a promise of peace to him.
My promise is that he and his descendants will be priests permanently because he stood up for his God and he made peace with the LORD for the Israelites."
The name of the Israelite man who was killed with the Midianite woman was Zimri, son of Salu. (Salu was the leader of a family from Simeon.)
The name of the Midianite woman who was killed was Cozbi, daughter of Zur. (Zur was the head of a family from the Midianite tribes.)
The LORD said to Moses,
"Treat the Midianites as your enemies, and kill them
because they treated you as enemies. They plotted to trick you in the incident that took place at Peor. They used their sister Cozbi, daughter of a Midianite leader, who was killed on the day of the plague caused by the incident at Peor."