“To inflict vengeance from the Lord on Midian.” For this man (Balaam), when he speaks no longer in the Spirit of God, but contrary to God's law, by setting up a different law with regard to fornication, is certainly not then to be counted as a prophet, but as a soothsayer. For he who did not keep to the commandment of God, received the just recompense of his own evil devices.
Source: Fragments from the Lost Writings of Irenaeus (New Advent)