(1) While Israel was staying at Shittim, the menfolk profaned themselves by whoring with the Moabite women, (2) who invited the menfolk to the sacrifices for their god. The menfolk partook of them and worshiped that god. (3) Thus Israel attached itself to Baal-peor, and יהוה was incensed with Israel. (4) יהוה said to Moses, “Take all the ringleaders and have them publicly impaled before יהוה, so that יהוה’s wrath may turn away from Israel.” (5) So Moses said to Israel’s officials, “Each of you slay those of his men who attached themselves to Baal-peor.” (6) Just then a certain Israelite man came and brought a Midianite woman over to his companions, in the sight of Moses and of the whole Israelite community who were weeping at the entrance of the Tent of Meeting. (7) When Phinehas, son of Eleazar son of Aaron the priest, saw this, he left the assembly and, taking a spear in his hand, (8) he followed the Israelite man into the chamber and stabbed both of them, the Israelite man and the woman, through the belly. Then the plague against the Israelites was checked. (9) Those who died of the plague numbered twenty-four thousand.
Fox translation
Israel stayed in Shittim/Acacias, and the people began to whore with the women of Moav. They called the people for sacrifices to their gods; the people ate and bowed down to their gods. And Israel yoked themselves to the Baal of Pe’or, so the anger of YHWH flared up against Israel, and YHWH said to Moshe: Take all the heads of the people and impale them to YHWH, facing the sun, so that the flaming anger of YHWH may turn from Israel.
Moshe said to the officials of Israel: Let each-man kill [those of] his men who yoked themselves to the Baal of Pe’or!
Now here, a man of the Children of Israel had come and had brought near to his brothers a [certain] Midyanitess, before the eyes of Moshe and before the eyes of the entire community of the Children of Israel while they were weeping at the entrance to the Tent of Appointment. Pin’has son of El’azar son of Aharon the priest saw [it], so he arose from the midst of the community, and took a spear in his hand; he came after the man of Israel into the private-chamber, and he thrust through the two of them, the man of Israel and the woman, in her private-parts, and the plague was held back from the Children of Israel. And those who died of the plague were four and twenty thousand.
Frymer-Kensky Translation from 'Reading the Women of the Bible' 2002
(15) When they came to the Reubenites, the Gadites, and the half-tribe of Manasseh in the land of Gilead, they spoke to them as follows: (16) “Thus said the whole community of the Eternal: What is this treachery that you have committed this day against the God of Israel, turning away from the Eternal, building yourselves an altar and rebelling this day against the Eternal! (17) Is the sin of Peor, which brought a plague upon the community of the Eternal, such a small thing to us? We have not cleansed ourselves from it to this very day; (18) and now you would turn away from the Eternal! If you rebel against the Eternal today, tomorrow God will be angry with the whole community of Israel.
(10) I found Israel [as pleasing]
As grapes in the wilderness;
Your fathers seemed to Me
Like the first fig to ripen on a fig tree.
But when they came to Baal-peor,
They turned aside to shamefulness;
Then they became as detested
As they had been loved.
(כח) וַ֭יִּצָּ֣מְדוּ לְבַ֣עַל פְּע֑וֹר וַ֝יֹּאכְל֗וּ זִבְחֵ֥י מֵתִֽים׃ (כט) וַ֭יַּכְעִיסוּ בְּמַ֥עַלְלֵיהֶ֑ם וַתִּפְרׇץ־בָּ֝֗ם מַגֵּפָֽה׃ (ל) וַיַּעֲמֹ֣ד פִּֽ֭ינְחָס וַיְפַלֵּ֑ל וַ֝תֵּעָצַ֗ר הַמַּגֵּפָֽה׃ (לא) וַתֵּחָ֣שֶׁב ל֭וֹ לִצְדָקָ֑ה לְדֹ֥ר וָ֝דֹ֗ר עַד־עוֹלָֽם׃
(28) They attached themselves to Baal Peor, ate sacrifices offered to the dead. (29) They provoked anger by their deeds, and a plague broke out among them. (30) Phinehas stepped forth and intervened (or prayed), and the plague ceased. (31) It was reckoned to his merit for all generations, to eternity.