The Lord told Moses:
References for Numbers 25:16
"Attack the Midianites and strike them dead.
For they attacked you with the treachery that they used against you in the Peor incident. They did the same in the case involving their sister Cozbi, daughter of the Midianite leader who was killed the day the plague came at Peor."