Now Joshua sent men from Jericho to Ai, which is near Beth Aven to the east of Bethel, and told them, “Go up and spy out the region.” So the men went up and spied out Ai.
From there he went on toward the hills east of Bethel and pitched his tent, with Bethel on the west and Ai on the east. There he built an altar to the Lord and called on the name of the Lord.
“Wail, Heshbon, for Ai is destroyed! Cry out, you inhabitants of Rabbah! Put on sackcloth and mourn; rush here and there inside the walls, for Molek will go into exile, together with his priests and officials.
“Though you, Israel, commit adultery, do not let Judah become guilty. “Do not go to Gilgal; do not go up to Beth Aven. And do not swear, ‘As surely as the Lord lives!’
On the north side their boundary began at the Jordan, passed the northern slope of Jericho and headed west into the hill country, coming out at the wilderness of Beth Aven.
Then Joshua son of Nun secretly sent two spies from Shittim. “Go, look over the land,” he said, “especially Jericho.” So they went and entered the house of a prostitute named Rahab and stayed there.
When they returned to Joshua, they said, “Not all the army will have to go up against Ai. Send two or three thousand men to take it and do not weary the whole army, for only a few people live there.”
The Philistines assembled to fight Israel, with three thousand chariots, six thousand charioteers, and soldiers as numerous as the sand on the seashore. They went up and camped at Mikmash, east of Beth Aven.