15 Then Joshua and all Israel acted like they were beaten before them, and they fled in the direction of the wilderness.
16 All of the people who were in the city were called to pursue after them. As they pursued after Joshua, they were drawn away from the city.
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.