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 plunder. 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. Do not be very far from the city. All of you must be ready.
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, ‘They are fleeing from us as they did the last time.’ When we flee,
7 then you 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 on fire 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 with the army.
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 warriors 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 in the valley.
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 place in front of the Arabah, not knowing that there was an ambush behind the city.
15 Joshua and the main body of the Israelites fled toward the wilderness, pretending defeat,
16 until the last of the soldiers in the city had been called out to pursue them. Since they were drawn away from the city, with everyone pursuing Joshua,
17 not a soldier remained in Ai or Bethel. They abandoned the city, leaving it open, as they pursued Israel.
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 army of Ai looked back, the smoke from the city was going up to the heavens. Escape in any direction was impossible, because the Israelites retreating toward the wilderness now turned on their pursuers;
21 for when Joshua and the main body of Israelites saw that the city had been taken by ambush and was going up in smoke, they struck back at the forces of Ai.
22 Since those in the city came out to intercept them, Ai’s army was hemmed in by Israelites on both sides, who cut them down without any fugitives or survivors
23 except the king, whom they took alive and brought to Joshua.
24 When Israel finished killing all the inhabitants of Ai in the open, who had pursued them into the wilderness, and all of them to the last man fell by the sword, 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 carried out the ban on all the inhabitants of Ai.
27 However, the Israelites took for themselves as plunder the livestock and the spoil of that city, according to the command of the Lord issued to Joshua.
28 Then Joshua destroyed Ai 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, on Mount Ebal, Joshua built to the Lord, the God of Israel, an altar
31 of unhewn stones on which no iron tool had been used, just as Moses, the servant of the Lord, had commanded the Israelites, as recorded in the book of the law. On this altar they sacrificed burnt offerings to the Lord and made communion sacrifices.
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, resident alien 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, just as Moses, the servant of the Lord, had first commanded for the blessing of the people of Israel.
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 assembly, including the women and children, and the resident aliens among them.