Joshua 6:21

21Then they adevoted all in the city to destruction, both men and women, young and old, oxen, sheep, and donkeys, with the edge of the sword.

Joshua 8:2

2And you shall do to Ai and its king as you did bto Jericho and its king. Only cits spoil and its livestock you shall take as plunder for yourselves. Lay an ambush against the city, behind it.”

Joshua 8:22-29

22And the others came out from the city against them, so they were in the midst of Israel, some on this side, and some on that side. And Israel struck them down, until there was dleft none that survived or escaped. 23But the king of Ai they took alive, and brought him near to Joshua.

24When Israel had finished killing all the inhabitants of Ai in the open wilderness where they pursued them, and all of them to the very last had fallen by the edge of the sword, all Israel returned to Ai and struck it down with the edge of the sword. 25And all who fell that day, both men and women, were 12,000, all the people of Ai. 26But Joshua did not draw back his hand with which he estretched out the javelin until he had devoted all the inhabitants of Ai to destruction.
That is, set apart ( devoted) as an offering to the Lord (for destruction)
27Only the livestock and the spoil of that city Israel took as their plunder, according to the word of the Lord that he gcommanded Joshua. 28So Joshua burned Ai and made it forever a hheap of ruins, as it is to this day. 29 iAnd he hanged the king of Ai on a tree until evening. jAnd at sunset Joshua commanded, and they took his body down from the tree and threw it at the entrance of the gate of the city and kraised over it a great heap of stones, which stands there to this day.

Copyright information for ESV