11 The entire army that was with him went up. They moved in close, in front of the city. Then they camped north of Ai, with the valley between them and Ai.
12 He took about five thousand men and positioned them as an ambush between Bethel and Ai to the west of the city.
13 The people positioned the main camp on the north side of the city and its rear guard on its west side. That night, Joshua went into the middle of the valley.
14 As soon as the king of Ai saw this, he and all his troops, the men of the city, hurried out early in the morning to meet Israel in battle. They moved out to the battleground on the slopes down toward the Jordan. He didn’t know that there was an ambush set against him behind the city.
15 Then Joshua and all Israel let themselves be beaten before them. They fled in the direction of the desert.
16 Next, all the troops who were still in the city were called out to chase them. They chased after Joshua and so let themselves be drawn away from the city.
17 No one who hadn’t gone out after Israel was left in either Ai or Bethel. They left the city wide open and chased after Israel.