Book of Exodus 17:8-13.
In those days, Amalek came and waged war against Israel.
Moses, therefore, said to Joshua, “Pick out certain men, and tomorrow go out and engage Amalek in battle. I will be standing on top of the hill with the staff of God in my hand.”
So Joshua did as Moses told him: he engaged Amalek in battle after Moses had climbed to the top of the hill with Aaron and Hur.
As long as Moses kept his hands raised up, Israel had the better of the fight, but when he let his hands rest, Amalek had the better of the fight.
Moses’ hands, however, grew tired; so they put a rock in place for him to sit on. Meanwhile Aaron and Hur supported his hands, one on one side and one on the other, so that his hands remained steady till sunset.
And Joshua mowed down Amalek and his people with the edge of the sword.