1The Lord said to Joshua, “Don't be afraid or downhearted! Take all the fighting men with you and attack Ai, for I'm handing over to you the king of Ai, his people, his town, and his land.
2You will do to Ai and its king what you did to Jericho and its king. However, this time you may keep for yourselves the plunder and the livestock. Set up an ambush behind the town.”
3So Joshua and all the people got ready to attack Ai. He chose thirty thousand of his best fighting men and sent them out at night.
4He ordered them, “You lie in ambush behind the town, not far away. All of you need to be ready.
5When I and the rest of the men with me approach the town, the defenders will run out to attack us just like before, and we'll run away from them.
6They'll chase after us as we draw them away from the town, because they'll say to each other, ‘They're running away from us just like before.’
7While we're running away from them, you will get up from your ambush positions and take the town for the Lord God will hand it over to you.
8Once you've captured the town, set it on fire, as the Lord has instructed. Now follow your orders.”
9Joshua sent them out, and they went to lie in ambush between Bethel and the west side of Ai. But that night Joshua stayed with the people in the camp.
10Early the next morning Joshua got up early and gathered the people and went up to attack Ai, accompanied by the elders of Israel.
11All the fighting men who were with him approached the front of the town, and camped there on the north side, with a valley between them and Ai.
12He took about five thousand men and had them lie in ambush between Bethel and Ai, to the west of the town.
13So the army took up their positions—the main army to the north of the town, and the ambush to the west. Joshua went that night to the valley.
14As soon as the king of Ai saw the situation, he and all his men rushed out early in the morning to attack the Israelites where they had before, at a place overlooking the Jordan valley. He didn't know about the ambush waiting on the other side of the town.
15Joshua and the Israelites allowed themselves to be driven back, and ran away in the direction of the wilderness.
16All the men of the town were called out to chase after them, and as they pursued Joshua they were drawn father from the town.
17There wasn't a man left in Ai and Bethel who didn't go out to chase the Israelites. They left the town wide open as they pursued the Israelites.
18Then the Lord told Joshua, “Hold up the spear in your hand and point it at Ai, because I'm giving it to you.” So Joshua held up the spear in his hand and pointed it at the town.
19As soon as they saw this signal the men lying in ambush got up and rushed into the town. They captured it, and quickly set it on fire.
20When the men of Ai looked back they saw the smoke rising up into the sky from the town. They had nowhere to run to, because the Israelites who had been running away towards the wilderness now turned on their pursuers.
21For when Joshua and the Israelites saw that the ambush group had captured the town, and that smoke was rising from it, they turned around and attacked the men of Ai.
22The men from the ambush also came from the town and attacked them, so they were caught on the middle, with the Israelites on both sides. The Israelites cut them down—not a single man survived or got away.
23Only the king of Ai was captured alive, and he was brought before Joshua.
24When the Israelites had finished killing the men of Ai who had chased them towards the wilderness—once they had all been cut down by the sword—the whole Israelite army returned to the town and killed everyone living there.
25Those who were killed that day numbered twelve thousand, men and women—all the inhabitants of Ai.
26For Joshua had continued to hold up his spear until all the people of Ai had been destroyed.
27Only the livestock and plunder were taken from the town by the Israelites, as the Lord had instructed Joshua.
28So Joshua burned the town of Ai, making it permanently into a heap of ruins where no one lives to this very day.
29He killed the king of Ai and hung his body on a tree until evening. When the sun went down Joshua ordered the body taken down. They threw it down in front of the entrance to the town gate and piled a heap of rocks over it which is still there today.
30Then Joshua built an altar on Mount Ebal for the Lord, the God of Israel.
31He did what Moses, the servant of the Lord, had told the Israelites to do, as recorded in the book of the Law of Moses: an altar of uncut stones which no one has worked with iron tools. On the altar they made burnt offerings and friendship offerings to the Lord.
32There in the presence of the Israelites, Joshua inscribed on the stones a copy of the Law of Moses.
33All the Israelites, the elders, the officers, and the judges stood in two groups facing each other with the priests, the Levites, and the Ark of the Lord's Agreement between them. (Included were the foreigners as well as the native born.) Half of them stood in front of Mount Gerizim, and half in front of Mount Ebal, just as Moses had ordered, for the blessing of the people this first time.
34Then Joshua read out the whole Law—all the blessings and curses recorded in the book of the Law.
35Joshua read out every word of Moses' instruction to the whole Israelite assembly, including the women, the children, and the foreigners who lived among them.