While Israel is at Shittim, the people begin to have immoral relations with the women of Moab. The women invite them to the sacrifices of their gods; the people eat and bow down to them, and so Israel yokes itself to Baal of Peor. The anger of the Lord is kindled against Israel. God commands Moses to take the chiefs of the people and execute them in the sight of the sun so that his anger turns away, and the judges are to put to death those who joined themselves to Baal of Peor.
While the people weep at the entrance of the tabernacle, an Israelite brings a Midianite woman to his family in the sight of Moses and the whole congregation. Phinehas, son of Eleazar and grandson of the priest Aaron, sees it, rises, takes a spear, follows the man into his tent and pierces them both. The plague stops, but twenty-four thousand have died.
The Lord tells Moses that Phinehas turned his anger away by being jealous for his honor, and grants him his covenant of peace and a perpetual priesthood for him and his descendants, because he made atonement for the Israelites. The text names the dead Israelite, Zimri, of the tribe of Simeon, and the woman, Cozbi, daughter of a chief of Midian. Finally, God commands that the Midianites be treated as enemies, because they deceived Israel with their schemes in the matter of Peor.