The Second Battle of Ai was a battle fought between the Israelites under Joshua and the Canaanites under the King of Ai.
Despite an initial defeat at Ai, Joshua decided to bring his entire army to attack Ai, this time with a clever strategy. He decided to position some of his troops on the plain in front of the ruin, challenging the Canaanites to fight him out in the open, as another force lay in ambush behind the city. The next morning, he set his 5,000 men in ambush between Bethel and Ai to the west of the city, and the King of Ai decided to attack the Israelite army, underestimating their strength. Ever man in Ai and Bethel went out after Israel, only for Joshua to call up his ambushers with the wave of his sword. The ambushers entered the empty city of Ai and burned it to the ground, while the Canaanites came to be surrounded by the Israelites and slaughtered. The King of Ai was taken alive and brought to Joshua to be hanged from a tree, and the Israelites slaughtered all the inhabitants of Ai in the open wilderness where they pursued them. The Israelites massacred 12,000 people of Ai that day, and Joshua left Ai as a heap of ruins.