After leaving Egypt, the Israelites had traveled through the wilderness and were camped at Rephidim. There the Amalekites came and attacked them. Amalek was a nomadic people living in the desert regions to the south.
Moses told Joshua to choose men and go out to fight Amalek. The next day, Moses said, he would stand on top of the hill with the staff of God in his hand. This was the staff Moses had carried when God acted in Egypt and at the Red Sea.
Joshua did as Moses said and fought against Amalek. Moses, his brother Aaron, and Hur went up to the top of the hill.
As long as Moses held up his hands, Israel was winning. Whenever he lowered his hands, Amalek was winning.
As time went on, Moses’ arms grew tired. Aaron and Hur took a stone and put it under him, and he sat on it. Then they held up his hands, one on one side and one on the other. So his hands stayed steady until the sun went down.
Joshua overcame Amalek and its army with the sword.
God told Moses to write this down in a book as a reminder and to make sure Joshua heard it. God would completely blot out the memory of Amalek from under heaven.
Moses built an altar and called it “The LORD Is My Banner.” He said that the LORD had sworn to fight against Amalek from generation to generation.