Numbers 25:1-5 NIV
While Israel was staying in Shittim, the men began to indulge in sexual immorality with Moabite women, who invited them to the sacrifices to their gods. The people ate the sacrificial meal and bowed down before these gods. So Israel yoked themselves to the Baal of Peor. And the LORD’s anger burned against them.
The LORD said to Moses, “Take all the leaders of these people, kill them and expose them in broad daylight before the LORD, so that the LORD’s fierce anger may turn away from Israel.”
So Moses said to Israel’s judges, “Each of you must put to death those of your people who have yoked themselves to the Baal of Peor.”
NIV: New International Version