Adoni-Zedek, king of Jerusalem, heard how Joshua captured Ai and annihilated it and its king as he did Jericho and its king. He also heard how the people of Gibeon made peace with Israel and lived among them.
So the five Amorite kings (the kings of Jerusalem, Hebron, Jarmuth, Lachish, and Eglon) and all their troops gathered together and advanced. They deployed their troops and fought against Gibeon.
The men of Gibeon sent this message to Joshua at the camp in Gilgal, "Do not abandon your subjects! Rescue us! Help us! For all the Amorite kings living in the hill country are attacking us."
The LORD routed them before Israel. Israel thoroughly defeated them at Gibeon. They chased them up the road to the pass of Beth Horon and struck them down all the way to Azekah and Makkedah.
As they fled from Israel on the slope leading down from Beth Horon, the LORD threw down on them large hailstones from the sky, all the way to Azekah. They died— in fact, more died from the hailstones than the Israelites killed with the sword.
The day the LORD delivered the Amorites over to the Israelites, Joshua prayed to the LORD before Israel: "O sun, stand still over Gibeon! O moon, over the Valley of Aijalon!"
The sun stood still and the moon stood motionless while the nation took vengeance on its enemies. The event is recorded in the Scroll of the Upright One. The sun stood motionless in the middle of the sky and did not set for about a full day.
But don't you delay! Chase your enemies and catch them! Don't allow them to retreat to their cities, for the LORD your God is handing them over to you."
When they brought the kings out to Joshua, he summoned all the men of Israel and said to the commanders of the troops who accompanied him, "Come here and put your feet on the necks of these kings." So they came up and put their feet on their necks.
At sunset Joshua ordered his men to take them down from the trees. They threw them into the cave where they had hidden and piled large stones over the mouth of the cave. (They remain to this very day.)
That day Joshua captured Makkedah and put the sword to it and its king. He annihilated everyone who lived in it; he left no survivors. He did to its king what he had done to the king of Jericho.
The LORD handed it and its king over to Israel, and Israel put the sword to all who lived there; they left no survivors. They did to its king what they had done to the king of Jericho.
The LORD handed Lachish over to Israel and they captured it on the second day. They put the sword to all who lived there, just as they had done to Libnah.
They captured it and put the sword to its king, all its surrounding cities, and all who lived in it; they left no survivors. As they had done at Eglon, they annihilated it and all who lived there.
They captured it, its king, and all its surrounding cities and put the sword to them. They annihilated everyone who lived there; they left no survivors. They did to Debir and its king what they had done to Libnah and its king and to Hebron.
Joshua defeated the whole land, including the hill country, the Negev, the lowlands, the slopes, and all their kings. He left no survivors. He annihilated everything that breathed, just as the LORD God of Israel had commanded.