Since those in the city came out to intercept them, Ai’s army was hemmed in by Israelites on both sides, who cut them down without any fugitives or survivors
and when the Lord, your God, gives them over to you and you defeat them, you shall put them under the ban. Make no covenant with them and do not be gracious to them.
Makkedah, too, Joshua captured and put to the sword at that time. He put the city, its king, and every person in it under the ban, leaving no survivors. Thus he did to the king of Makkedah what he had done to the king of Jericho.
for when Joshua and the main body of Israelites saw that the city had been taken by ambush and was going up in smoke, they struck back at the forces of Ai.