At the moment they began their jubilant praise, the Lord laid an ambush against the Ammonites, Moabites, and those of Mount Seir who were coming against Judah, so that they were defeated.
Over the walls of Babylon raise a signal, reinforce the watch; Post sentries, arrange ambushes! For the Lord has both planned and carried out what he spoke against the inhabitants of Babylon.
but the women and children and livestock and anything else in the city—all its spoil—you may take as plunder for yourselves, and you may enjoy this spoil of your enemies, which the Lord, your God, has given you.
The Lord said to me, Do not be afraid of him, for I have delivered him into your power with all his people and his land. Do to him as you did to Sihon, king of the Amorites, who reigned in Heshbon.
Now when Adonizedek, king of Jerusalem, heard that Joshua had captured Ai and put it under the ban, and had done to that city and its king as he had done to Jericho and its king, and that the inhabitants of Gibeon had made their peace with Israel, remaining among 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.
All the spoil and livestock of these cities the Israelites took as plunder; but the people they put to the sword, until they had destroyed the last of them, leaving none alive.
The king of Ai saw this, and he and all his army came out very early in the morning to engage Israel in battle at the place in front of the Arabah, not knowing that there was an ambush behind the city.
When Israel finished killing all the inhabitants of Ai in the open, who had pursued them into the wilderness, and all of them to the last man fell by the sword, then all Israel returned and put to the sword those inside the city.
Then Joshua sent them away. They went to the place of ambush, taking up their position to the west of Ai, toward Bethel. Joshua, however, spent that night with the army.