It came to pass, when Israel had made an end of killing all the inhabitants of Ai in the field and in the wilderness where they pursued them, and they had all fallen by the mouth of the sword until they were finished off, that all Israel returned to Ai and struck it with the mouth of the sword.

“the mouth of the sword.” Used to show great destruction, as if the sword was eating its victims (see commentary on Josh. 6:21).
“and struck it with the mouth of the sword.” The Israelites returned to Ai and killed all those who had not joined the army of Ai in the battle.