21When Joshua and all Israel saw that the men in ambush had captured the city and that smoke was rising from it, they turned around and struck down the men of Ai.
22Meanwhile, those in the ambush came out of the city against them, and the men of Ai were trapped between the Israelite forces on both sides. So Israel struck them down until no survivor or fugitive remained.
— Joshua 8:21-22