So he took about five thousand men and set them in ambush between Bethel and Ai, on the west side of the city.