Now Yahweh said to Joshua, “Do not fear or be dismayed. Take all the people of war with you and arise, go up to Ai; see, I have given into your hand the king of Ai, his people, his city, and his land.
So you shall do to Ai and its king just as you did to Jericho and its king; you shall take only its spoil and its cattle as plunder for yourselves. Set an ambush for the city behind it.”
Then I and all the people who are with me will come near the city. And it will be that when they come out to meet us as at the first, we will flee before them.
And they will come out after us until we have drawn them away from the city, for they will say, ‘They are fleeing before us as at the first.’ So we will flee before them.
Then it will be that when you have seized the city, that you shall set the city on fire. You shall do it according to the word of Yahweh. See, I have commanded you.”
So Joshua sent them away, and they went to the place of ambush and remained between Bethel and Ai, on the west side of Ai; but Joshua spent that night among the people.
Then all the people of war who were with him went up and drew near and arrived in front of the city and camped on the north side of Ai. Now there was a valley between him and Ai.
So they set the people, all the army that was on the north side of the city, and its rear guard on the west side of the city, and Joshua went that night into the midst of the valley.
Now it happened that when the king of Ai saw it, the men of the city hurried and rose up early and went out to meet Israel in battle, he and all his people at the appointed place before the desert plain. But he did not know that there was an ambush against him behind the city.
Then Yahweh said to Joshua, “Stretch out the javelin that is in your hand toward Ai, for I will give it into your hand.” So Joshua stretched out the javelin that was in his hand toward the city.
Then the men in ambush rose quickly from their place, and when he had stretched out his hand, they ran and entered the city and captured it, and they quickly set the city on fire.
Then the men of Ai turned back and looked, and behold, the smoke of the city ascended to the sky, and they had no place to flee this way or that, for the people who had been fleeing to the wilderness turned against the pursuers.
But Joshua and all Israel saw that the men in ambush had captured the city and that the smoke of the city ascended. So they turned back and struck down the men of Ai.
And the others came out from the city to meet them, so that they were trapped in the midst of Israel, some on this side and some on that side; and they struck them down until there was no one remaining for him who survived or escaped.
Now it happened that when Israel had finished killing all the inhabitants of Ai in the field in the wilderness where they pursued them, and all of them fell by the edge of the sword until they were completely destroyed, then all Israel turned back to Ai and struck it with the edge of the sword.
And he hanged the king of Ai on a tree until evening; and at sunset Joshua gave a command, and they took his body down from the tree and threw it at the entrance of the city gate and raised over it a great heap of stones that stands to this day.
just as Moses the servant of Yahweh had commanded the sons of Israel, as it is written in the book of the law of Moses, an altar of uncut stones on which no man had wielded an iron tool; and they offered burnt offerings on it to Yahweh and sacrificed peace offerings.
And all Israel with their elders and officers and their judges were standing on both sides of the ark before the Levitical priests who carried the ark of the covenant of Yahweh, the sojourner as well as the native. Half of them stood in front of Mount Gerizim and half of them in front of Mount Ebal, just as Moses the servant of Yahweh had given a command at first to bless the people of Israel.
There was not a word of all that Moses had commanded which Joshua did not read before all the assembly of Israel with the women and the little ones and the sojourners who were going among them.