3 So Joshua arose, and all the people of war, to go up against Ai; and Joshua chose thirty thousand mighty men of valor and sent them away by night. 4 And he commanded them, saying: “Behold, you shall lie in ambush against the city, behind the city. Do not go very far from the city, but all of you be ready. 5 Then I and all the people who are with me will approach the city; and it will come about, when they come out against us as at the first, that we shall flee before them. 6 For they will come out after us till we have drawn them from the city, for they will say, ‘They are fleeing before us as at the first.’ Therefore we will flee before them. 7 Then you shall rise from the ambush and seize the city, for the Lord your God will deliver it into your hand. 8 And it will be,
when you have taken the city, that you shall set the city on fire. According to the commandment of the Lord you shall do. See, I have commanded you.”
...
24 And it came to pass when Israel had made an end of slaying all the inhabitants of Ai in the field, in the wilderness where they pursued them, and when they all had fallen by the edge of the sword until they were consumed, that all the Israelites returned to Ai and struck it with the edge of the sword. 25 So it was that all who fell that day, both men and women, were twelve thousand—all the people of Ai. 26 For Joshua did not draw back his hand, with which he stretched out the spear, until he had utterly destroyed all the inhabitants of Ai. 27 Only the livestock and the spoil of that city Israel took as booty for themselves, according to the word of the Lord which He had commanded Joshua