Numbers 25:3-9

So Israel yoked himself to Baal of Peor. And the anger of the  Lord was kindled against Israel. And the  Lord said to Moses, a Take all the chiefs of the people and b hang
Or impale
them
in the sun before the  Lord, d that the fierce anger of the  Lord may turn away from Israel.”
And Moses said to e the judges of Israel, f Each of you kill those of his men who have yoked themselves to Baal of Peor.”

And behold, one of the people of Israel came and brought a Midianite woman to his family, in the sight of Moses and in the sight of the whole congregation of the people of Israel, while they were g weeping in the entrance of the tent of meeting. h When Phinehas i the son of Eleazar, son of Aaron the priest, saw it, he rose and left the congregation and took a spear in his hand and went after the man of Israel into the chamber and pierced both of them, the man of Israel and the woman through her belly. Thus the plague on the people of Israel was stopped. Nevertheless, j those who died by the plague were twenty-four thousand.

Copyright information for ESV