Exodus 17:8-16

Israel defeats Amalek

8 Amalek came and fought with Israel at Rephidim.
9 Moses said to Joshua, "Choose some men for us and go fight with Amalek. Tomorrow I'll stand on top of the hill with the shepherd's rod of God in my hand."
10 So Joshua did as Moses told him. He fought with Amalek while Moses, Aaron, and Hur went up to the top of the hill.
11 Whenever Moses held up his hand, Israel would start winning the battle. Whenever Moses lowered his hand, Amalek would start winning.
12 But Moses' hands grew tired. So they took a stone and put it under Moses so he could sit down on it. Aaron and Hur held up his hands, one on each side of him so that his hands remained steady until sunset.
13 So Joshua defeated Amalek and his army with the sword.
14 Then the LORD said to Moses, "Write this as a reminder on the scroll and read it to Joshua: I will completely wipe out the memory of Amalek under the sky."
15 Moses built an altar there and called it, "The LORD is my banner."
16 He said, "The power of the LORD's banner! The LORD is at war with Amalek in every generation."