Now when Israel was living in Shittim the people became false to the Lord, doing evil with the daughters of Moab:
Numbers 25:1
Through Phinehas, and because of his passion for my honour, my wrath has been turned away from the children of Israel, so that I have not sent destruction on them all in my wrath. So say to them that I will make with him an agreement of peace: And by this agreement, he and his sons after him have the right to be priests for ever; because, by his care for the honour of his God, he took away the sin of the children of Israel.
Numbers 25:11-13