Then the lot for the sons of Joseph went out from the Jordan at Jericho to the waters of Jericho on the east into the wilderness, going up from Jericho through the hill country to Bethel.
And their border on the north side was from the Jordan; then the border went up to the side of Jericho on the north and went up through the hill country westward, and it ended at the wilderness of Beth-aven.
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.
So the sons of Benjamin saw that they were defeated. Now the men of Israel had given ground to Benjamin because they relied on the men in ambush whom they had set against Gibeah.
Therefore, they turned their backs before the men of Israel toward the direction of the wilderness, but the battle overtook them, and those who came out of the cities destroyed them in the midst of them.