1. Then Yahweh said to Joshua: "Do not fear or be discouraged. March with all your warriors against the city of Ai. I will give into your hands its king and its people, the city and its territory.
2. You shall deal with Ai as you have dealt with Jericho and its king. But you may take possession of the plunder and all the animals. So now, prepare an ambush behind the city."
3. So Joshua left with all his warriors and went up to Ai. Then he chose thirty thousand valiant warriors, and sent them out by night.
4. And he commanded them: "Lie in ambush behind the city. Do not go very far and be ready.
5. I and all the people who are with me shall close in on the city. But when they come out against us, as they did before, we shall flee from them.
6. Then they shall pursue us and go out far from the city, thinking that we are fleeing from them as before.
7. But then you shall rise from where you are hiding and occupy the city. Yahweh, our God, will give it to us.
8. After taking the city, you shall burn it according to what Yahweh has commanded. These are my orders."
9. So Joshua sent them out and they went to the place of ambush, between Bethel and Ai, to the west of the city, while Joshua slept that night in the midst of his people.
10. Very early in the morning, Joshua rose and mustered his army, and then marched at the head of the people, accompanied by the leaders.
11. All the warriors who were with him went up and marched until they reached the front of the city. Then they encamped opposite the northern side of the city. The valley separated them from the city.
12. (Then he took five thousand men whom he set in ambush between Bethel and Ai, to the west of the city.)
13. The people then set up their camp to the north of the city and their rearguard to the west. That night Joshua was in the valley.
14. When the king of Ai saw the situation, he made haste with all his people to attack Israel on the slope opposite the valley of Jordan, without knowing that the Israelites had prepared an ambush behind the city.
15. Joshua and the Israelites pretended that they were being defeated, and so fled to the road leading to the wilderness.
16. Then all the people of the city began to shout and left to pursue them.
17. No one remained to defend the city, and they left the city open.
18. Then Yahweh said to Joshua: "Stretch out toward Ai the javelin you have in your hand because I have given you this city."
19. So Joshua did this, and at this sign the warriors rose out of their places in the ambush and ran to the city. They entered and seized the city, and set it on fire.
20. The men of Ai looked back and saw the smoke of the city rising up to heaven, and at the same time, the Israelites who were fleeing turned back upon them.
21. They lost their courage as they were trapped by the Israelites:
22. for on one side were Joshua and all the people of Israel, and on the other, those who had just set the city on fire. The Israelites killed them until none were left to survive or to escape.
23. Only the king of Ai was taken alive and they brought him to Joshua.
24. The Israelites killed the inhabitants of Ai who went into the fields or who fled to the wilderness; they killed them all. Then they returned to the city and killed all by the sword.
25. The total of those who fell that day was twelve thousand.
26. Joshua did not give the order to stop the war until all the inhabitants of Ai had been killed in accordance with anathema.
27. But the Israelites took for themselves the livestock and plunder as Yahweh had commanded.
28. Joshua burned the city and left it in ruins. That place has remained as it was to this day.
29. As for the king of Ai, Joshua had him hanged on a tree until the sun set. Then he had his body taken down; they cast it at the entrance of the city and raised over it a great heap of stones which can be seen to this day.
30. Joshua then built an altar to Yahweh, the God of Israel, on Mount Ebal.
31. He fulfilled what Moses had commanded the children of Israel. And according to what is written in the book of the Law of Moses, the altar was made of uncut stones and was built without the use of an iron tool. On this altar, he offered burnt offerings and peace offerings to Yahweh.
32. There in the presence of the Israelites he wrote upon the stones a copy of the Law which Moses had written.
33. All the people stood on both sides of the Ark, with their leaders, secretaries and judges. Opposite it were the priests and the Levites who carried the Ark of Yahweh. Israelites by birth and aliens were together. Half the people were in front of Mount Gerizim and the other half were near Mount Ebal according to Moses' commandment for the blessing of Israel.
34. Joshua proceeded to read the words of blessing and curse, and all that is written in the book of the Law.
35. He did not omit any word from all that was written by Moses. He read it with a loud voice before the assembly of all Israel, including women, children and foreigners who lived among them.