Exodus 17:8, 9, 10, 11, 12, 13, 14, 15, 16
Exodus 17:10 NIV
So Joshua fought the Amalekites as Moses had ordered, and Moses, Aaron and Hur went to the top of the hill.
Exodus 17:11 NIV
As long as Moses held up his hands, the Israelites were winning, but whenever he lowered his hands, the Amalekites were winning.