Joshua 8:17

And there was not a man left in Ai or Beth-el, that went not out after Israel: and they left the city open, and pursued after Israel.

This verse belongs to the account of Israel's conquest of Ai after marching from Gilgal. That conquest of Ai followed the overthrow of Jericho.

It describes Israel's renewed second advance against Ai after Achan was punished by execution of the divine sentence, which turned away God's wrath from Israel. The advance came by God's command to marshal all the men of war and go again against Ai. Israel soon took the city because God's power was with His people, with the armies of Heaven fighting for Israel and putting their enemies to flight.