5. They were guilty of a great sin in the matter of Peor; and this was the sin of the new generation, when they were within a step of Canaan (v. 28): They joined themselves to Baal-peor, and so were entangled both in idolatry and in adultery, in corporeal and in spiritual whoredom, Num. xxv. 1-3. Those that did often partake of the altar of the living God now ate the sacrifices of the dead, of the idols of Moab (that were dead images, or dead men canonized or deified), or sacrifices to the infernal deities on the behalf of their dead friends. Thus they provoked God to anger with their inventions (v. 29), in contempt of him and his institutions, his commands, and his threatenings. The iniquity of Peor was so great that, long after, it is said, They were not cleansed from it, Josh. xxii. 17. God testified his displeasure at this, (1.) By sending a plague among them, which in a little time swept away 24,000 of those impudent sinners. (2.) By stirring up Phinehas to use his power as a magistrate for the suppressing of the sin and checking the contagion of it. He stood up in his zeal for the Lord of hosts, and executed judgment upon Zimri and Cozbi, sinners of the first rank, genteel sinners; he put the law in execution upon them, and this was a service so pleasing to God that upon it the plague was stayed, v. 30. By this, and some other similar acts of public justice on that occasion (Num. xxv. 4, 5), the guilt ceased to be national, and the general controversy was let fall. When the proper officers did their duty God left it to them, and did not any longer keep the work in his own hands by the plague. Note, National justice prevents national judgments. But, Phinehas herein signalizing himself, a special mark of honour was put upon him, for what he did was counted to him for righteousness to all generations (v. 31), and, in recompence of it, the priesthood was entailed on his family. He shall make an atonement by offering up the sacrifices, who had so bravely made an atonement (so some read it, v. 30) by offering up the sinners. Note, It is the honour of saints to be zealous against sin.