Joshua 8:24

And it came to pass, when Israel had made an end of slaying all the inhabitants of Ai in the field, in the wilderness wherein they chased them, and when they were all fallen on the edge of the sword, until they were consumed, that all the Israelites returned unto Ai, and smote it with the edge of the sword.

Joshua 8:24 belongs to Israel's conquest of Ai, which followed the overthrow of Jericho in the campaign that began from Gilgal, Israel's first encampment in the promised land. The account in Joshua 8:1-29 records that conquest of Ai after the defeat of Jericho. It describes the second advance against Ai, undertaken after the execution of the divine sentence upon Achan turned away God's wrath from Israel.

God commanded Joshua to marshal all the men of war and advance against Ai again, and the armies of heaven fought for Israel so that their enemies were put to flight. The victory shows that Israel's only hope was in obedience to God. After this victory the Lord worked mightily for His people as they pressed forward, gaining fresh courage with every victory, until the whole land was taken just as the Lord had told Moses and every good promise to Israel came to pass.