International Standard Version
1The LORD then told Joshua, "Don't be afraid or lose heart! Take all the fighting men with you, and go up right now to Ai. Take note that I have handed over the king of Ai into your control, along with his people, his city, and his land. 2Do to Ai and its king as you did to Jericho and its king, but take its spoil and its livestock as war booty for yourselves. Set an ambush around the city."
3So Joshua and all of the fighting men prepared to go out against Ai. Joshua selected 30,000 valiant warriors and sent them out by night, 4telling them, "Pay attention now! You are to set up an ambush around the city. Don't go very far from the city, and all of you remain on alert. 5I and all of the army with me will advance upon the city. When they come out after us like they did before, we'll run away from them. 6They'll come after us until we've drawn them away from the city, because they'll say, 'They're running away from us just like they did before.' While we're running away from them, 7you get up from the ambush and seize the city, because the LORD your God will give it into your control. 8When you've taken the city, set it on fire, just as the LORD ordered. Look! These are your orders!" 9So Joshua sent them out, and they set up an ambush between Bethel and Ai, to the west of Ai. Joshua spent that night in the camp among the army.
10In the morning, Joshua got up early, mustered his army, and set off for Ai, accompanied by the elders of Israel in full view of the army. 11The entire fighting force with him attacked, approaching the city, and camped on the north side of Ai, with a ravine between them and Ai. 12Taking about 5,000 men, he set them in ambush between Bethel and Ai to the west of the city, 13stationing their forces with its main encampment north of the city and its rear guard to the west. Joshua spent that night in the valley. 14When the king of Ai saw what had happened, he and his army quickly got up early and went out to meet Israel in battle. He and all his people met at the place adjacent to the desert plain. But he didn't know about the ambush that had been set for him on the other side of the city. 15Because Joshua and the entire fighting force of Israel pretended to lose the battle by running away in front of them toward the wilderness, 16everyone in the city followed after them. As they pursued Joshua, they were drawn away from the town. 17There wasn't a single man left in Ai or Bethel who didn't run out after Israel. They left the city open and pursued Israel.
18Then the LORD told Joshua, "Stretch out the battle lance that's in your hand toward Ai, because I will give it into your control." So Joshua stretched out the battle lance that was in his hand toward the city. 19As soon as he stretched out his hand, the troops in ambush quickly got up from their place of hiding and attacked. They entered the city, seized it, and immediately set it on fire. 20Then the men of Ai looked back behind them—and all of a sudden!—smoke from the city was rising into the sky. They were unable to run in any direction, because the Israelis who had fled toward the wilderness had turned around to attack their pursuers. 21When Joshua and the entire fighting force of Israel observed that the men who had been in ambush had seized the city and that the smoke from the city was rising, they turned around and attacked the men of Ai. 22Then the others came out from the city against them, so the men of Ai were surrounded by the Israelis, some on one side and some on the other. Israel attacked them until no one was left to survive or escape. 23But the king of Ai was taken alive and brought to Joshua.
24When Israel had completed executing all of the residents of Ai in the open wilderness where they had chased them, and after all of them—to the very last of them—had been killed by swords, the entire fighting force of Israel returned to Ai and attacked it with swords. 25The total of all who fell that day, including men and women, was 12,000—the entire population of Ai. 26Joshua did not cease his attack until he had completely destroyed every inhabitant of Ai. 27Israel took only the livestock and the spoil of that city as their war booty, in accordance with what the LORD had commanded to Joshua. 28Joshua burned Ai, turning it into a permanent mound of ruins, and it remains so to this day. 29He hanged the king of Ai on a tree until dusk, and at sunset Joshua ordered his body brought down from the tree and laid at the entrance to the gate of the town. There he raised over it a large mound of stones, which stands there to this day.
30Then Joshua built an altar to the LORD God of Israel, on Mount Ebal, 31just the way Moses the servant of the LORD had commanded the Israelis in the Book of the Law of Moses: "—an altar of uncut stones that hasn't been worked with iron tools—" and they offered burnt offerings to the LORD on it, along with peace offerings. 32There Joshua inscribed on stones a copy of the Law of Moses that Moses had presented to the Israelis. 33All Israel, both foreigners and citizens, together with their elders, officers, and judges, stood on opposite sides of the Ark of the Covenant of the LORD. Half stood in front of Mount Gerizim and half stood in front of Mount Ebal, just as Moses, the LORD's servant had commanded at the first, so that they could bless the people of Israel. 34Afterwards, Joshua read all the words of the Law—both the blessings and the curses—according to everything written in the Book of the Law. 35There wasn't one word of everything Moses had commanded that Joshua did not read in front of the entire assembly of Israel, including the women, their little ones, and the foreigners who lived among them.