Then the LORD said to Joshua, "Do not be afraid or discouraged. Take the entire army and attack Ai, for I have given to you the king of Ai, his people, his city, and his land.
You will destroy them as you destroyed Jericho and its king. But this time you may keep the captured goods and the cattle for yourselves. Set an ambush behind the city."
So Joshua and the army of Israel set out to attack Ai. Joshua chose thirty thousand fighting men and sent them out at night
with these orders: "Hide in ambush close behind the city and be ready for action.
When our main army attacks, the men of Ai will come out to fight as they did before, and we will run away from them.
We will let them chase us until they have all left the city. For they will say, 'The Israelites are running away from us as they did before.'
Then you will jump up from your ambush and take possession of the city, for the LORD your God will give it to you.
Set the city on fire, as the LORD has commanded. You have your orders."
So they left that night and lay in ambush between Bethel and the west side of Ai. But Joshua remained among the people in the camp that night.
Early the next morning Joshua roused his men and started toward Ai, accompanied by the leaders of Israel.
They camped on the north side of Ai, with a valley between them and the city.
That night Joshua sent five thousand men to lie in ambush between Bethel and Ai, on the west side of the city.
So they stationed the main army north of the city and the ambush west of the city. Joshua himself spent that night in the valley.
When the king of Ai saw the Israelites across the valley, he and all his army hurriedly went out early the next morning and attacked the Israelites at a place overlooking the Jordan Valley. But he didn't realize there was an ambush behind the city.
References for Joshua 8:14
Joshua and the Israelite army fled toward the wilderness as though they were badly beaten,
and all the men in the city were called out to chase after them. In this way, they were lured away from the city.
There was not a man left in Ai or Bethel who did not chase after the Israelites, and the city was left wide open.
References for Joshua 8:17
Then the LORD said to Joshua, "Point your spear toward Ai, for I will give you the city." Joshua did as he was commanded.
As soon as Joshua gave the signal, the men in ambush jumped up and poured into the city. They quickly captured it and set it on fire.
When the men of Ai looked behind them, smoke from the city was filling the sky, and they had nowhere to go. For the Israelites who had fled in the direction of the wilderness now turned on their pursuers.
When Joshua and the other Israelites saw that the ambush had succeeded and that smoke was rising from the city, they turned and attacked the men of Ai.
Then the Israelites who were inside the city came out and started killing the enemy from the rear. So the men of Ai were caught in a trap, and all of them died. Not a single person survived or escaped.
Only the king of Ai was taken alive and brought to Joshua.
When the Israelite army finished killing all the men outside the city, they went back and finished off everyone inside.
So the entire population of Ai was wiped out that day -- twelve thousand in all.
For Joshua kept holding out his spear until everyone who had lived in Ai was completely destroyed.
References for Joshua 8:26
Only the cattle and the treasures of the city were not destroyed, for the Israelites kept these for themselves, as the LORD had commanded Joshua.
So Ai became a permanent mound of ruins, desolate to this very day.
References for Joshua 8:28
Joshua hung the king of Ai on a tree and left him there until evening. At sunset the Israelites took down the body and threw it in front of the city gate. They piled a great heap of stones over him that can still be seen today.
Then Joshua built an altar to the LORD, the God of Israel, on Mount Ebal.
He followed the instructions that Moses the LORD's servant had written in the Book of the Law: "Make me an altar from stones that are uncut and have not been shaped with iron tools." Then on the altar they presented burnt offerings and peace offerings to the LORD.
And as the Israelites watched, Joshua copied the law of Moses onto the stones of the altar.
References for Joshua 8:32
Then all the Israelites -- foreigners and citizens alike -- along with the leaders, officers, and judges, were divided into two groups. One group stood at the foot of Mount Gerizim, the other at the foot of Mount Ebal. Each group faced the other, and between them stood the Levitical priests carrying the Ark of the LORD's covenant. This was all done according to the instructions Moses, the servant of the LORD, had given for blessing the people of Israel.
Joshua then read to them all the blessings and curses Moses had written in the Book of the Law.
Every command Moses had ever given was read to the entire assembly, including the women and children and the foreigners who lived among the Israelites.