1. The LORD then said to Joshua, "Do not be afraid or dismayed. Take all the army with you and prepare to attack Ai. I have delivered the king of Ai into your power, with his people, city, and land.
2. Do to Ai and its king what you did to Jericho and its king; except that you may take its spoil and livestock as booty. Set an ambush behind the city."
3. So Joshua and all the soldiers prepared to attack Ai. Picking out thirty thousand warriors, Joshua sent them off by night
4. with these orders: "See that you ambush the city from the rear, at no great distance; then all of you be on the watch.
5. The rest of the people and I will come up to the city, and when they make a sortie against us as they did the last time, we will flee from them.
6. They will keep coming out after us until we have drawn them away from the city, for they will think we are fleeing from them as we did the last time. When this occurs,
7. rise from ambush and take possession of the city, which the LORD, your God, will deliver into your power.
8. When you have taken the city, set it afire in obedience to the LORD'S command. These are my orders to you."
9. Then Joshua sent them away. They went to the place of ambush, taking up their position to the west of Ai, toward Bethel. Joshua, however, spent that night in the plain.
10. Early the next morning Joshua mustered the army and went up to Ai at its head, with the elders of Israel.
11. When all the troops he led were drawn up in position before the city, they pitched camp north of Ai, on the other side of the ravine.
12. (He took about five thousand men and set them in ambush between Bethel and Ai, west of the city.)
13. Thus the people took up their stations, with the main body north of the city and the ambush west of it, and Joshua waited overnight among his troops.
14. The king of Ai saw this, and he and all his army came out very early in the morning to engage Israel in battle at the descent toward the Arabah, not knowing that there was an ambush behind the city.
15. Joshua and the main body of the Israelites fled in seeming defeat toward the desert,
16. till the last of the soldiers in the city had been called out to pursue them.
17. Since they were drawn away from the city, with every man engaged in this pursuit of Joshua and the Israelites, not a soldier remained in Ai (or Bethel), and the city was open and unprotected.
18. Then the LORD directed Joshua, "Stretch out the javelin in your hand toward Ai, for I will deliver it into your power." Joshua stretched out the javelin in his hand toward the city,
19. and as soon as he did so, the men in ambush rose from their post, rushed in, captured the city, and immediately set it on fire.
20. By the time the men of Ai looked back, the smoke from the city was already sky-high. Escape in any direction was impossible, because the Israelites retreating toward the desert now turned on their pursuers;
21. for when Joshua and the main body of Israelites saw that the city had been taken from ambush and was going up in smoke, they struck back at the men of Ai.
22. Since those in the city came out to intercept them, the men of Ai were hemmed in by Israelites on either side, who cut them down without any fugitives or survivors
23. except the king, whom they took alive and brought to Joshua.
24. All the inhabitants of Ai who had pursued the Israelites into the desert were slain by the sword there in the open, down to the last man. Then all Israel returned and put to the sword those inside the city.
25. There fell that day a total of twelve thousand men and women, the entire population of Ai.
26. Joshua kept the javelin in his hand stretched out until he had fulfilled the doom on all the inhabitants of Ai.
27. However, the Israelites took for themselves as booty the livestock and the spoil of that city, according to the command of the LORD issued to Joshua.
28. Then Joshua destroyed the place by fire, reducing it to an everlasting mound of ruins, as it remains today.
29. He had the king of Ai hanged on a tree until evening; then at sunset Joshua ordered the body removed from the tree and cast at the entrance of the city gate, where a great heap of stones was piled up over it, which remains to the present day.
30. Later Joshua built an altar to the LORD, the God of Israel, on Mount Ebal,
31. of unhewn stones on which no iron tool had been used, in keeping with the command to the Israelites of Moses, the servant of the LORD, as recorded in the book of the law. On this altar they offered holocausts and peace offerings to the LORD.
32. There, in the presence of the Israelites, Joshua inscribed upon the stones a copy of the law written by Moses.
33. And all Israel, stranger and native alike, with their elders, officers and judges, stood on either side of the ark facing the levitical priests who were carrying the ark of the covenant of the LORD. Half of them were facing Mount Gerizim and half Mount Ebal, thus carrying out the instructions of Moses, the servant of the LORD, for the blessing of the people of Israel on this first occasion.
34. Then were read aloud all the words of the law, the blessings and the curses, exactly as written in the book of the law.
35. Every single word that Moses had commanded, Joshua read aloud to the entire community, including the women and children, and the strangers who had accompanied Israel.