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.
When Joab saw that there was a battle line in front of him and another behind him, he chose some men out of all the elite troops of Israel and lined up in battle formation to engage the Arameans.
Now Adoni-zedek king of Jerusalem heard that Joshua had captured Ai and completely destroyed it, treating Ai and its king as he had Jericho and its king, and that the inhabitants of Gibeon had made peace with Israel and were living among them.
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.
Then men in 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,