At this time Adoni-Zedek king of Jerusalem heard that Joshua had defeated Ai and completely destroyed it, as he had also done to Jericho and its king. The king also learned that the Gibeonites had made a peace agreement with Israel and that they lived nearby.
Adoni-Zedek and his people were very afraid because of this. Gibeon was not a little town like Ai; it was a large city, as big as a city that had a king, and all its men were good fighters.
So Adoni-Zedek king of Jerusalem sent a message to Hoham king of Hebron, Piram king of Jarmuth, Japhia king of Lachish, and Debir king of Eglon. He begged them,
"Come with me and help me attack Gibeon, which has made a peace agreement with Joshua and the Israelites."
Then these five Amorite kings -- the kings of Jerusalem, Hebron, Jarmuth, Lachish, and Eglon -- gathered their armies, went to Gibeon, surrounded it, and attacked it.
The Gibeonites sent this message to Joshua in his camp at Gilgal: "Don't let us, your servants, be destroyed. Come quickly and help us! Save us! All the Amorite kings from the mountains have joined their armies and are fighting against us."
So Joshua marched out of Gilgal with his whole army, including his best fighting men.
The Lord said to Joshua, "Don't be afraid of those armies, because I will hand them over to you. None of them will be able to stand against you."
Joshua and his army marched all night from Gilgal for a surprise attack.
The Lord confused those armies when Israel attacked, so Israel defeated them in a great victory at Gibeon. They chased them along the road going up to Beth Horon and killed men all the way to Azekah and Makkedah.
As they chased the enemy down the Beth Horon Pass to Azekah, the Lord threw large hailstones on them from the sky and killed them. More people were killed by the hailstones than by the Israelites' swords.
On the day that the Lord gave up the Amorites to the Israelites, Joshua stood before all the people of Israel and said to the Lord: "Sun, stand still over Gibeon. Moon, stand still over the Valley of Aijalon."
So the sun stood still, and the moon stopped until the people defeated their enemies. These words are written in the Book of Jashar. The sun stopped in the middle of the sky and waited to go down for a full day.
That has never happened at any time before that day or since. That was the day the Lord listened to a human being. Truly the Lord was fighting for Israel!
After this, Joshua and his army went back to the camp at Gilgal.
During the fight the five kings ran away and hid in a cave near Makkedah,
but someone found them hiding in the cave at Makkedah and told Joshua.
So he said, "Cover the opening of the cave with large rocks. Put some men there to guard it,
but don't stay there yourselves. Continue chasing the enemy and attacking them from behind. Don't let them get to their cities, because the Lord your God will hand them over to you."
So Joshua and the Israelites killed the enemy, but a few were able to get back to their strong, walled cities.
After the fighting, Joshua's men came back safely to him at Makkedah. No one was brave enough to say a word against the Israelites.
Joshua said, "Move the rocks that are covering the opening of the cave and bring those five kings out to me."
So Joshua's men brought the five kings out of the cave -- the kings of Jerusalem, Hebron, Jarmuth, Lachish, and Eglon.
When they brought the five kings out to Joshua, he called for all his men. He said to the commanders of his army, "Come here! Put your feet on the necks of these kings." So they came close and put their feet on their necks.
Joshua said to his men, "Be strong and brave! Don't be afraid, because I will show you what the Lord will do to the enemies you will fight in the future."
Then Joshua killed the five kings and hung their bodies on five trees, where he left them until evening.
At sunset Joshua told his men to take the bodies down from the trees. Then they threw them into the same cave where they had been hiding and covered the opening of the cave with large rocks, which are still there today.
That day Joshua defeated Makkedah. He killed the king and completely destroyed all the people in that city as an offering to the Lord; no one was left alive. He did the same thing to the king of Makkedah that he had done to the king of Jericho.
Joshua and all the Israelites traveled from Makkedah to Libnah and attacked it.
The Lord handed over the city and its king. They killed every person in the city; no one was left alive. And they did the same thing to that king that they had done to the king of Jericho.
Then Joshua and all the Israelites left Libnah and went to Lachish, which they surrounded and attacked.
The Lord handed over Lachish on the second day. The Israelites killed everyone in that city just as they had done to Libnah.
During this same time Horam king of Gezer came to help Lachish, but Joshua also defeated him and his army; no one was left alive.
Then Joshua and all the Israelites went from Lachish to Eglon. They surrounded Eglon, attacked it, and
captured it the same day. They killed all its people and completely destroyed everything in it as an offering to the Lord, just as they had done to Lachish.
Then Joshua and the Israelites went from Eglon to Hebron and attacked it,
capturing it and all the little towns near it. The Israelites killed everyone in Hebron; no one was left alive there. Just as they had done to Eglon, they completely destroyed the city and all its people as an offering to the Lord.
Then Joshua and the Israelites went back to Debir and attacked it.
They captured that city, its king, and all the little towns near it, completely destroying everyone in Debir as an offering to the Lord; no one was left alive there. Israel did to Debir and its king just as they had done to Libnah and its king, just as they had done to Hebron.
So Joshua defeated all the kings of the cities of these areas: the mountains, southern Canaan, the western hills, and the slopes. The Lord, the God of Israel, had told Joshua to completely destroy all the people as an offering to the Lord, so he left no one alive in those places.
Joshua captured all the cities from Kadesh Barnea to Gaza, and from Goshen to Gibeon.
He captured all these cities and their kings on one trip, because the Lord, the God of Israel, was fighting for Israel.
Then Joshua and all the Israelites returned to their camp at Gilgal.