Numbers 25:1-5 King James Version (KJV)
25 And Israel abode in Shittim, and the people began to commit whoredom with the daughters of Moab.
2 And they called the people unto the sacrifices of their gods: and the people did eat, and bowed down to their gods.
3 And Israel joined himself unto Baalpeor: and the anger of the Lord was kindled against Israel.
4 And the Lord said unto Moses, Take all the heads of the people, and hang them up before the Lord against the sun, that the fierce anger of the Lord may be turned away from Israel.
5 And Moses said unto the judges of Israel, Slay ye every one his men that were joined unto Baalpeor.