He took five thousand men and set an ambush west of the city between Bethel and Ai.