Then the Lord said to Joshua, "Don't be afraid or give up. Lead all your fighting men to Ai. I will help you defeat the king of Ai, his people, his city, and his land.
You will do to Ai and its king what you did to Jericho and its king. Only this time you may take all the wealth and keep it for yourselves. Now tell some of your soldiers to set up an ambush behind the city."
So Joshua led his whole army toward Ai. Then he chose thirty thousand of his best fighting men and sent them out at night.
Joshua gave them these orders: "Listen carefully. You must set up an ambush behind the city. Don't go far from it, but continue to watch and be ready.
I and the men who are with me will march toward the city, and the men in the city will come out to fight us, just as they did before. Then we will turn and run away from them.
They will chase us away from the city, thinking we are running away from them as we did before. When we run away,
come out from your ambush and take the city. The Lord your God will give you the power to win.
After you take the city, burn it. See to it! You have your orders."
Then Joshua sent them to wait in ambush between Bethel and Ai, to the west of Ai. But Joshua stayed the night with his people.
Early the next morning Joshua gathered his men together. He and the older leaders of Israel led them up to Ai.
All of the soldiers who were with Joshua marched up to Ai and stopped in front of the city and made camp north of it. There was a valley between them and the city.
Then Joshua chose about five thousand men and set them in ambush in the area west of the city between Bethel and Ai.
So the people took their positions; the main camp was north of the city, and the other men were hiding to the west. That night Joshua went down into the valley.
Now when the king of Ai saw the army of Israel, he and his people got up early the next morning and hurried out to fight them. They went out to a place east of the city, but the king did not know soldiers were waiting in ambush behind the city.
Joshua and all the men of Israel let the army of Ai push them back. Then they ran toward the desert.
The men in Ai were called to chase Joshua and his men, so they left the city and went after them.
All the men of Ai and Bethel chased the army of Israel. The city was left open; not a man stayed to protect it.
Then the Lord said to Joshua, "Hold your spear toward Ai, because I will give you that city." So Joshua held his spear toward the city of Ai.
When the Israelites who were in ambush saw this, they quickly came out of their hiding place and hurried toward the city. They entered the city, took control of it, and quickly set it on fire.
When the men of Ai looked back, they saw smoke rising from their city. At the same time the Israelites stopped running and turned against the men of Ai, who could not escape in any direction.
When Joshua and all his men saw that the army had taken control of the city and saw the smoke rising from it, they stopped running and turned to fight the men of Ai.
The men who were in ambush also came out of the city to help with the fight. So the men of Ai were caught between the armies of Israel. None of the enemy escaped. The Israelites fought until not one of the men of Ai was left alive, except
the king of Ai, and they brought him to Joshua.
During the fighting the army of Israel chased the men of Ai into the fields and desert and killed all of them. Then they went back to Ai and killed everyone there.
All the people of Ai died that day, twelve thousand men and women.
Joshua had held his spear toward Ai, as a sign to destroy the city, and did not draw it back until all the people of Ai were destroyed.
The people of Israel kept for themselves the animals and the other things the people of Ai had owned, as the Lord had commanded Joshua to do.
Then Joshua burned the city of Ai and made it a pile of ruins. And it is still like that today.
Joshua hanged the king of Ai on a tree and left him there until evening. At sunset Joshua told his men to take the king's body down from the tree and to throw it down at the city gate. Then they covered it with a pile of rocks, which is still there today.
Joshua built an altar for the Lord, the God of Israel, on Mount Ebal, as
Moses, the Lord's servant, had commanded. Joshua built the altar as it was explained in the Book of the Teachings of Moses. It was made from uncut stones; no tool was ever used on them. On that altar the Israelites offered burnt offerings to the Lord and fellowship offerings.
There Joshua wrote the teachings of Moses on stones for all the people of Israel to see.
The older leaders, officers, judges, and all the Israelites were there; Israelites and non-Israelites were all standing around the Ark of the Agreement with the Lord in front of the priests, the Levites who had carried the Ark. Half of the people stood in front of Mount Ebal, and half stood in front of Mount Gerizim. This was the way the Lord's servant Moses had earlier commanded the people to be blessed.
Then Joshua read all the words of the teachings, the blessings and the curses, exactly as they were written in the Book of the Teachings.
All the Israelites were gathered together -- men, women, and children -- along with the non-Israelites who lived among them. Joshua read every command that Moses had given.