Joshua sent men from Jericho to Ai, which is near Beth-aven, east of Bethel, and said to them, “Go up and spy out the land.” And the men went up and spied out Ai.
From there he moved on to the hill country on the east of Bethel and pitched his tent, with Bethel on the west and Ai on the east, and there he built an altar to the Lord and invoked the name of the Lord.
Wail, O Heshbon, for Ai is laid waste! Cry out, O daughters of Rabbah! Put on sackcloth, lament, and slash yourselves with whips! For Milcom shall go into exile, with his priests and his attendants.
Though you prostitute yourself, O Israel, do not let Judah become guilty. Do not enter into Gilgal or go up to Beth-aven, and do not swear, “As the Lord lives.”
On the north side their boundary began at the Jordan; then the boundary goes up to the slope of Jericho on the north, then up through the hill country westward; and it ends at the wilderness of Beth-aven.
Then Joshua son of Nun sent two men secretly from Shittim as spies, saying, “Go, view the land, especially Jericho.” So they went and entered the house of a prostitute whose name was Rahab and spent the night there.
Then they returned to Joshua and said to him, “Not all the people need go up; about two or three thousand men should go up and attack Ai. Since they are so few, do not make the whole people toil up there.”
The Philistines mustered to fight with Israel: thirty thousand chariots, and six thousand horsemen, and troops like the sand on the seashore in multitude; they came up and encamped at Michmash, to the east of Beth-aven.
So the Lord gave Israel the victory that day. The battle passed beyond Beth-aven, and the troops with Saul numbered altogether about ten thousand men. The battle spread out over the hill country of Ephraim.