Lo, when Adoni-Zedek, King of Jerusalem, heard what had come to pass at Ai and Jericho, and that Joshua had executed both kings, and that the Gibeonites had made peace with the Hebrews and accepted enslavement, he became really freaked, because he had always thought of Gibeon as a city equal in strength and power as his own. So Adoni-Zedek King sent forth messengers to Hoham, King of Hebron; Piram, King of Jarmoth; Japhis, King of Lachish; and Debin, King of Elgon, treating them to band with him to attack Gibeon for betraying them all.
Then the army of Five Kings marched forth toward Gibeon, and the Gibeonites send word to Joshua, praying for the mighty warrior to save his vassals. Joshua was all, No one but me fucks with my bitch! and he and the Hebrews marched forth to defend Gibeon.
And lo, the army of the Five Kings broke before the Hebrew onslaught and scattered to the winds. While the Hebrews were pursing many of the them up the slope of Beth-Hom, a fortuitous hailstorm completely decimated the Canaanite and Amorite forces and utterly demoralized the survivors. Of course everyone attributed the storm the the Hebrew storm God, which emboldened the Hebrews further.
Then Joshua prayed to God and God stopped the sun for a whole day to prove Its mightiness. Later, the Hebrews returned to their base camp at Gilgal.
Next morning, word was brought to Joshua that the five kings were pinned down in a cave near Makkedah. So Joshua ordered that the cave be rocked up and a guard left to watch it while he and the rest of the forces went to root out and kill any straggling soldiers to prevent as many as possible from making back to their homes.
When they finally gave up the pursuit, Joshua and the Hebrews returned to the camp at the cave. The kings were dragged out and Joshua ordered his top five men to place a foot against the neck of each king. Then Joshua swore to them that God had promised that they would do thusly to all of their enemies.
Afterwards, Joshua had the kings hanged and then tossed their bodies back in the gave and rocked it back up.
And so perished Adoni-Zedek, King of Jerusualem; Hoham, King of Hebron; Piram, King of Jarmoth; Japhis, King of Lachish; and Debin, King of Elgon.
Then the Hebrews marched on Makkedah and took it, slaughtering the inhabitants and burning the city to the ground.
Next, the Hebrews began systematically razing every city in southern Canaan, from Lachish, Gezer, Hebron and every settlement in the hill country and the Negeb.
Eventually base camp moved to Kadesh-barneas, from which Joshua conquered Gaza and Goshen, slaughtering nearly every human and animals except the Gibeonites.