Yahweh said to Joshua, Stretch out the javelin that is in your hand toward Ai; for I will give it into your hand. Joshua stretched out the javelin that was in his hand toward the city.
The course of the battle is rendered somewhat obscure by the same thing being told twice, but the substance is sufficiently plain. The children of Israel retreated feigning fear, and the battle had not actually commenced before the inhabitants of Ai were precluded from returning and defending their city. After the two armies had come to close quarters, the ambuscade arose and made such haste that the flames of the conflagration were rising from the city when the enemy turned their backs. From this we may infer that the city was in the possession of the Israelites, but that the chief slaughter took place when those who were in the city came forth to take part in the battle, because the inhabitants, hemmed in on all sides, found resistance and flight equally unavailing. They were thus seized with despair, and, huddled together in a narrow space, were everywhere cut down. 