God indicated that the war against Midian would be Moses' last in these words, "Avenge the children of Israel of the Midianites: afterward shalt thou be gathered unto thy people." The connection between the war and Moses' death is as follows. When God announced to Moses that he was to die on this side of the Jordan, Moses implored God with the words: "O Lord of the world! Is it right that death should so soon overtake me, that have seen Thy ways, Thy actions, and Thy path?"

God replied, saying: "Moses, if a long life were better for men, surely I should not then have permitted thy ancestors to taste of death; but it is better for thee if thou are taken from this world than if thou wert to remain in it." Moses was not, however, satisfied with this answer from God, whereupon God said: "Well then, thou mayest live many years longer, yea, thou shalt live even to a thousand years, but know thou that Israel will not then conquer their foes, and that Midian will not be brought under their yoke."

In this way was Moses made to yield by God, for he thought, "Whether I die to-day or to-morrow matters little, for death will come to me at last. I would rather see Israel conquer their foes and bring Midian under their yoke than that I should live longer." God therefore bade Moses avenge Israel of the Midianites, if he was thereupon ready to die.