Joshua 8:2-12

2 You will do the same thing to Ai and its king that you did to Jericho and its king. However, you may take its loot and livestock for yourselves. Set an ambush behind the city."
3 So Joshua and all the soldiers started to march against Ai. Joshua picked 30,000 of his best soldiers and sent them out at night
4 with these orders: "Set an ambush behind the city. Don't go very far away from the city. Everyone must be ready.
5 I'll approach the city with the rest of the troops. When they come out to attack us as they did the first time, we will run away from them.
6 They'll come out after us, and we will lure them away from the city. They'll say, 'They're running away from us just like the first time.' As we run away from them,
7 you come out of hiding and capture the city. The LORD your God will hand it over to you.
8 When you have captured the city, set it on fire. Do what the LORD says. These are your orders."
9 So Joshua sent them out, and they hid. They took their position west of Ai, between Bethel and Ai. Joshua spent the night with the troops.
10 Joshua got up early in the morning and assembled the troops. Then he and the leaders of Israel led the army to Ai.
11 All the troops with him marched until they were near the city. They camped north of Ai with the ravine between them and Ai.
12 Joshua had taken about five thousand men and had them hide between Bethel and Ai, west of the city.