17 Not a man remained in Ai or Bethel who had not gone out after Israel; they left the city open and pursued after Israel.
18 And Yahweh said to Joshua, “Stretch out the sword that is in your hand to Ai, because I will give it into your hand.” And Joshua stretched out the sword that was in his hand to the city.
19 The moment he stretched out his hand, those in the ambush stood up quickly from their place and ran. And they went into the city and captured it, quickly setting the city ablaze with fire.
20 Then the men of Ai looked behind them, and they saw smoke from the city rising to the sky; they had no power to flee this way or that, and the people fleeing the wilderness turned around to the pursuers.
21 And Joshua and all Israel saw that the ambush had captured the city and that the smoke of the city was rising; they returned and struck down the men of Ai.
22 Then the others from the city came out to meet them, and they found themselves surrounded by Israel, some on one side, and others on the other side. And they struck them down until no survivor or fugitive was left.
23 But they captured the king of Ai alive, and they brought him to Joshua.