He took about five thousand men and had them lie in ambush between Bethel and Ai, to the west of the town.