The LORD said to Joshua, "Do not be afraid or discouraged. Take the whole military force with you and go attack Ai. Look, I have handed over to you the king of Ai, his people, city, and land.
They will come after us until we have drawn them away from the city, for they will say, 'They are fleeing from us as before.' While we are fleeing from them,
So Joshua sent them out, and they went to the ambush site and waited between Bethel and Ai, to the west of Ai. But he spent that night with the troops.
All those who were with him went up and approached the city, arriving opposite Ai, and camped to the north of it, with a valley between them and the city.
The military force was stationed in this way: the main camp to the north of the city and its rear guard to the west of the city. And that night Joshua went into the valley.
When the king of Ai saw [the Israelites], the men of the city hurried and went out early in the morning, so that he and all his people could engage Israel in battle at a suitable place facing the plain [of the Jordan]. But he did not know there was an ambush [waiting] for him behind the city.
Then the LORD said to Joshua, "Hold out the sword in your hand toward Ai, for I will hand the city over to you." So Joshua held out his sword toward it.
When he held out his hand, the men in ambush rose quickly from their position. They ran, entered the city, captured it, and immediately set it on fire.
The men of Ai turned and looked back, and smoke from the city was rising to the sky! They could not escape in any direction, and the troops who had fled to the wilderness now became the pursuers.
When Joshua and all Israel saw that the [men in] ambush had captured the city and that smoke was rising from it, they turned back and struck down the men of Ai.
The men in the ambush came out of the city against them, and the men of Ai were [trapped] between the Israelite forces, some on one side and some on the other. They struck them down until no survivor or fugitive remained,
When Israel had finished killing everyone living in Ai who had pursued them into the open country, and when every last one of them had fallen by the sword, all Israel returned to Ai and struck it down with the sword.
He hung [the body of] the king of Ai on a tree until evening, and at sunset Joshua commanded that they take his body down from the tree. They threw it down at the entrance of the city gate and put a large pile of rocks over it, which remains to this day.
just as Moses the LORD's servant had commanded the Israelites. He built it according to what is written in the book of the law of Moses: an altar of uncut stones on which no iron tool has been used. Then they offered burnt offerings to the LORD and sacrificed fellowship offerings on it.
All Israel, foreigner and citizen alike, with their elders, officers, and judges, stood on either side of the ark of the LORD's covenant facing the Levitical priests who carried it. As Moses the LORD's servant had commanded earlier, half of them were in front of Mount Gerizim and half in front of Mount Ebal, to bless the people of Israel.
Afterwards, Joshua read aloud all the words of the law-- the blessings as well as the curses-- according to all that is written in the book of the law.
There was not a word of all that Moses had commanded that Joshua did not read before the entire assembly of Israel, including the women, little children, and foreigners who were with them.