1 While Israel remained encamped in Shittim, the people began to commit sexual immorality with Moabite women, 2 who also invited the people to the sacrifices of their gods. So the people ate what they had sacrificed and then worshipped their gods. 3 The people joined the Baal-peor cult. As a result, the anger of the LORD flared up against Israel, 4 so the LORD told Moses, "Take all the leaders of the people and execute them in broad daylight for the LORD, so the LORD's burning anger may be withdrawn from Israel."
5 Then Moses ordered the judges of Israel, "Each one of you is to execute the men in his own tribe who joined the Baal-peor cult."
6 That very moment, one of the Israelis arrived, bringing to his brothers one of the Midianite women, right in front of Moses and the entire community of Israel, while they were weeping at the entrance to the Tent of Meeting! 7 When Eleazar's son Phinehas, grandson of Aaron the priest saw this, he jumped up from the middle of the community, grabbed a javelin in his hand, 8 followed the Israeli man inside his tent, and impaled the two of them the Israeli man and the woman right through both of them and into her abdomen. Then the plague infecting the Israelis was brought to a halt. Nevertheless, 9 24,000 people died because of the plague.
10 The LORD told Moses, 11 "Eleazar's son Phinehas, grandson of Aaron the priest, has turned my wrath away from Israel. Because his zealousness reflected my own zeal for them, I didn't consume Israel in my jealousy. 12 Therefore, I'm certainly going to be giving him my covenant of peace, 13 for him and for his descendants after him, too, a covenant of perpetual priesthood, because he was zealous for his God and made atonement for the Israelis."
14 Now the name of the Israeli man who was slain, along with the Midianite woman, was Salu's son Zimri, a leader from the tribe of Simeon. 15 The woman who was slain, that is, the Midianite woman, was named Cozbi. She was the daughter of Zur, a leader of one of the ancestral houses of Midian.
16 Later, the LORD ordered Moses, 17 "Attack the Midianites and execute them, 18 because they've acted deceitfully, bringing trouble to you in this incident at Peor with Cozbi, daughter of a prince from Midian, who was killed during the plague that came about because of the incident at Peor."