Joshua 8:24

When Israel had finished killing all the men of Ai who had pursued them into the field and wilderness, and when every last one of them had fallen by the sword, all the Israelites returned to Ai and put it to the sword as well.
BSB · Berean Standard Bible
And it came to pass, when Israel had made an end of slaying all the inhabitants of Ai in the field, in the wilderness wherein they chased them, and when they were all fallen on the edge of the sword, until they were consumed, that all the Israelites returned unto Ai, and smote it with the edge of the sword.
KJV · King James Version
When Israel had finished killing all the inhabitants of Ai in the field, in the wilderness in which they pursued them, and they had all fallen by the edge of the sword until they were consumed, all Israel returned to Ai and struck it with the edge of the sword.
WEB · World English Bible
And it came to pass, when Israel had made an end of slaying all the inhabitants of Ai in the field, in the wilderness wherein they pursued them, and they were all fallen by the edge of the sword, until they were consumed, that all Israel returned unto Ai, and smote it with the edge of the sword.
ASV · American Standard Version

Related passages

From the Treasury of Scripture Knowledge, grouped by the word they explain.

returned unto Ai
This must refer to the women, children, and old persons left behind; for it seems that all the effective men had sallied out when they imagined the Israelites had fled. (ver. 16.)
Joshua 10:30–41; Joshua 11:10–14; Numbers 21:24