The Bible – Old Testament
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.
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.”
1 So Joshua and all the soldiers prepared to attack Ai. Picking out thirty thousand warriors, Joshua sent them off by night
with these orders: “See that you ambush the city from the rear, at no great distance; then all of you be on the watch.
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.
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,
rise from ambush and take possession of the city, which the LORD, your God, will deliver into your power.
When you have taken the city, set it afire in obedience to the LORD’S command. These are my orders to you.”
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.
Early the next morning Joshua mustered the army and went up to Ai at its head, with the elders of Israel.
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.
(He took about five thousand men and set them in ambush between Bethel and Ai, west of the city.)
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.
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.
Joshua and the main body of the Israelites fled in seeming defeat toward the desert,
till the last of the soldiers in the city had been called out to pursue them.
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.
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,
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.
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;
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.
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
except the king, whom they took alive and brought to Joshua.
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.
There fell that day a total of twelve thousand men and women, the entire population of Ai.
Joshua kept the javelin in his hand stretched out until he had fulfilled the doom on all the inhabitants of Ai.
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.
Then Joshua destroyed the place by fire, reducing it to an everlasting mound of ruins, as it remains today.
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.
2 Later Joshua built an altar to the LORD, the God of Israel, on Mount Ebal,
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.
There, in the presence of the Israelites, Joshua inscribed upon the stones a copy of the law written by Moses.
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.
Then were read aloud all the words of the law, the blessings and the curses, exactly as written in the book of the law.
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.
1  Thirty thousand warriors: this figure of the Hebrew text, which seems extremely high, may be due to a copyist’s error; some manuscripts of the Septuagint have “three thousand,” which is the number of the whole army in the first, unsuccessful attack (⇒ Joshua 7:4); the variant reading in ⇒ Joshua 8:12 mentions “five thousand.”