Numbers 25:4-9 - God's Punishment
4 And Jehovah said to Moses, Take all the heads of the people and hang them up before Jehovah against the sun, so that the fierce anger of Jehovah may be turned away from Israel.
5 And Moses said to the judges of Israel, Every one of you kill his men who were joined to Baal-peor.
6 And behold! One of the sons of Israel came and brought to his brothers a woman of Midian, before the eyes of Moses, and before all the congregation of the sons of Israel, who were weeping before the door of the tabernacle of the congregation. 7 And when Phinehas, the son of Eleazar, the son of Aaron the priest, saw it, he rose up from among the congregation and took a spear in his hand. 8 And he went after the man of Israel into the tent, and pierced both of them through, the man of Israel, and the woman, through her belly. So the plague was stayed from the sons of Israel. 9 And those that died in the plague were twenty-four thousand.