The LORD said to Joshua, "Don't be terrified or afraid. Take all the troops with you, and march against Ai. I am about to hand the king of Ai, his people, city, and land over to you.
You will do the same thing to Ai and its king that you did to Jericho and its king. However, you may take its loot and livestock for yourselves. Set an ambush behind the city."
So Joshua and all the soldiers started to march against Ai. Joshua picked 30,000 of his best soldiers and sent them out at night
with these orders: "Set an ambush behind the city. Don't go very far away from the city. Everyone must be ready.
I'll approach the city with the rest of the troops. When they come out to attack us as they did the first time, we will run away from them.
They'll come out after us, and we will lure them away from the city. They'll say, 'They're running away from us just like the first time.' As we run away from them,
you come out of hiding and capture the city. The LORD your God will hand it over to you.
When you have captured the city, set it on fire. Do what the LORD says. These are your orders."
So Joshua sent them out, and they hid. They took their position west of Ai, between Bethel and Ai. Joshua spent the night with the troops.
Joshua got up early in the morning and assembled the troops. Then he and the leaders of Israel led the army to Ai.
All the troops with him marched until they were near the city. They camped north of Ai with the ravine between them and Ai.
Joshua had taken about five thousand men and had them hide between Bethel and Ai, west of the city.
All the troops were positioned. The main camp was north of the city, and the other troops were hiding west of the city. That night Joshua went down into the middle of the valley.
When the king of Ai saw the main camp, he and all his troops got up early in the morning. They rushed out toward the plains to meet Israel for battle, just where [Joshua] expected. However, the king didn't know there were troops behind the city waiting to attack him.
Joshua and all Israel pretended to be defeated. They ran away toward the desert.
All the troops in the city were called out to chase them. As they chased Joshua, they were lured away from the city.
Not one man was left in Ai or Bethel; they all went after Israel. So the city was left unprotected as they chased Israel.
Then the LORD said to Joshua, "Hold out the spear in your hand toward the city, because I am handing Ai over to you." So Joshua held out his spear.
The men who were hiding got up as soon as he stretched out his hand. They entered the city, captured it, and quickly set it on fire.
When the men of Ai looked back, they could see the city going up in smoke. They had no place to go, since the Israelites, who had been running toward the desert, had now turned back on them.
When Joshua and all Israel saw that the men who had been hiding had captured the city and that it was going up in smoke, they turned and attacked the men of Ai.
The men who had captured the city also came out and attacked them. The men of Ai were caught between the battle lines of Israel. So Israel attacked them on both sides. None of them survived or escaped.
But they captured the king of Ai alive and brought him to Joshua.
Israel had finished killing all the inhabitants of Ai in the fields and in the desert where they had been pursued. They put them all to death; not one person survived. Then the Israelites went back to Ai and killed everyone left there.
Twelve thousand men and women from Ai died that day.
Joshua did not lower his hand holding the spear until he had completely destroyed all the inhabitants of Ai.
Israel took the loot and the livestock of that city for themselves, as the LORD had commanded Joshua.
So Joshua burned Ai and made it a deserted mound of ruins. It is still in ruins today.
Joshua hung the king of Ai's [dead body] on a pole and left him there until evening. When the sun went down, Joshua gave the order to take his body down. They threw it in the entrance of the city and made a large pile of stones over it. That pile is still there today.
At that time Joshua built an altar on Mount Ebal to the LORD God of Israel.
He built an altar with uncut stones on which no iron chisels had been used. This was as the LORD's servant Moses had commanded the people of Israel in the Book of Moses' Teachings. They made burnt offerings to the LORD and sacrificed fellowship offerings on the altar.
There in front of the people of Israel he wrote on stone slabs a copy of the Teachings which Moses had written down.
All the people of Israel, whether foreigners or native Israelites, the leaders, officers, and judges were standing on opposite sides of the ark. They faced the Levitical priests who carried the ark of the LORD's promise. Half of the people were in front of Mount Gerizim and the other half in front of Mount Ebal. Right from the beginning, the LORD's servant Moses had commanded the priests to bless the people of Israel this way.
Afterwards, Joshua read all the Teachings--the blessings and curses--as they had all been written down by Moses.
Joshua read [Moses' Teachings] in front of the whole assembly of Israel, including women, children, and foreigners living among them. He did not leave out one word from everything Moses had commanded.