The Fall to Joshua
When God brought the Children of Israel out of Egypt and into the Promised Land, Ai was one of the cities they had to conquer. On their first attempt, the Israelites were defeated because there was sin among them. (See Joshua Chapter 7.) Joshua asked God for help, and God gave Joshua a battle plan.
God 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. ... Set an ambush for the city behind it." (Joshua 8:1--2)
"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." (Joshua 8:11)
"And he took about 5,000 men and set them in ambush between Bethel and Ai, on the west side of the city." (Joshua 8:12)
"And it came about when the King of Ai saw it, that 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." (Joshua 8:14)