19 The men who were hiding got up as soon as he stretched out his hand. They entered the city, captured it, and quickly set it on fire.
20 When the men of Ai looked back, they could see the city going up in smoke. They had no place to go, since the Israelites, who had been running toward the desert, had now turned back on them.
21 When Joshua and all Israel saw that the men who had been hiding had captured the city and that it was going up in smoke, they turned and attacked the men of Ai.
22 The men who had captured the city also came out and attacked them. The men of Ai were caught between the battle lines of Israel. So Israel attacked them on both sides. None of them survived or escaped.
23 But they captured the king of Ai alive and brought him to Joshua.
24 Israel had finished killing all the inhabitants of Ai in the fields and in the desert where they had been pursued. They put them all to death; not one person survived. Then the Israelites went back to Ai and killed everyone left there.
25 Twelve thousand men and women from Ai died that day.