Joshua 8:12-14

8:12 He took five thousand men and set an ambush west of the city between Bethel and Ai. 8:13 The army was in position – the main army north of the city and the rear guard west of the city. That night Joshua went into the middle of the valley.

8:14 When the king of Ai saw Israel, he and his whole army quickly got up the next day and went out to fight Israel at the meeting place near the Arabah. But he did not realize men were hiding behind the city.

Joshua 8:19

8:19 When he held out his hand, the men waiting in ambush rose up quickly from their place and attacked. They entered the city, captured it, and immediately set it on fire.