Numbers 31:3

Overview - Numbers 31
The Midianites are spoiled, and Balaam slain.
13 Moses is wroth with the officers, for saving the women alive.
19 How the soldiers, with their captives and spoil, are to be purified.
25 The proportion in which the prey is to be divided.
48 The voluntary oblation unto the treasury of the Lord.
Treasury of Scripture Knowledge

Numbers 31:3  (King James Version)
And Moses spake unto the people, saying, Arm some of yourselves unto the war, and let them go against the Midianites, and avenge the LORD of Midian.

Arm some
Exodus 17:9-13

avenge the Lord
It was God's quarrel, not their own, that they were now to take up. These people were idolaters, and had seduced the Israelites to practise the same abominations. Idolatry is an offence against God; and the civil power has no authority to meddle with what belongs to Him, without especial directions, certified, as in this case, in the most unequivocal manner. Private revenge, ambition, or avarice were to have no place in this business: Jehovah is to be avenged; and through Him, the children of Israel, (ver. 2,) because they were nearly ruined by their idolatries. If Jehovah, instead of punishing sinners by earthquakes, pestilence, or famine,is pleased expressly to command any person or people to avenge his cause, this commission justifies, nay sanctifies, war, massacre, or devastation. Though none at present shew such a commission, yet the Israelites could; and it is therefore absurd to censure Moses, Joshua, and Israel, for the dreadful slaughter made by them. God himself passed sentence of condemnation, and employed them merely as ministers of his vengeance; and unless it could be proved that the criminals did not deserve their doom, or that God had no right to punish his rebellious creatures, such objectors only shew their enmity to God by becoming the unsolicited advocates of his enemies.
Numbers 25:11 Numbers 25:13 Exodus 17:16 ; Leviticus 26:25 ; Judges 5:2 Judges 5:23 ; 2 Kings 9:7 ; 10:30 Jeremiah 46:10
Jeremiah 50:28