1 Now Adoni-zedek, king of Jerusalem, heard that Joshua had captured and completely destroyed* Ai and killed its king, just as he had destroyed the city of Jericho and killed its king. He also learned that the Gibeonites had made peace with Israel and were now their allies.1
2 He and his people became very afraid when they heard all this because Gibeon was a large city--as large as the royal cities and larger than Ai. And the Gibeonite men were mighty warriors.
3 So King Adoni-zedek of Jerusalem sent messengers to several other kings: Hoham of Hebron, Piram of Jarmuth, Japhia of Lachish, and Debir of Eglon.
4 "Come and help me destroy Gibeon," he urged them, "for they have made peace with Joshua and the people of Israel."
5 So these five Amorite kings combined their armies for a united attack. They moved all their troops into place and attacked Gibeon.
6 The men of Gibeon quickly sent messengers to Joshua at Gilgal, "Don't abandon your servants now!" they pleaded. "Come quickly and save us! For all the Amorite kings who live in the hill country have come out against us with their armies."
7 So Joshua and the entire Israelite army left Gilgal and set out to rescue Gibeon.
8 "Do not be afraid of them," the LORD said to Joshua, "for I will give you victory over them. Not a single one of them will be able to stand up to you."
9 Joshua traveled all night from Gilgal and took the Amorite armies by surprise.
10 The LORD threw them into a panic, and the Israelites slaughtered them in great numbers at Gibeon. Then the Israelites chased the enemy along the road to Beth-horon and attacked them at Azekah and Makkedah, killing them along the way.
11 As the Amorites retreated down the road from Beth-horon, the LORD destroyed them with a terrible hailstorm that continued until they reached Azekah. The hail killed more of the enemy than the Israelites killed with the sword.
12 On the day the LORD gave the Israelites victory over the Amorites, Joshua prayed to the LORD in front of all the people of Israel. He said, "Let the sun stand still over Gibeon, and the moon over the valley of Aijalon."
13 So the sun and moon stood still until the Israelites had defeated their enemies. Is this event not recorded in [The Book of Jashar]*? The sun stopped in the middle of the sky, and it did not set as on a normal day.2
14 The LORD fought for Israel that day. Never before or since has there been a day like that one, when the LORD answered such a request from a human being.
15 Then Joshua and the Israelite army returned to their camp at Gilgal.
16 During the battle, the five kings escaped and hid in a cave at Makkedah.
17 When Joshua heard that they had been found,
18 he issued this command: "Cover the opening of the cave with large rocks and place guards at the entrance to keep the kings inside.
19 The rest of you continue chasing the enemy and cut them down from the rear. Don't let them get back to their cities, for the LORD your God has given you victory over them."
20 So Joshua and the Israelite army continued the slaughter and wiped out the five armies except for a tiny remnant that managed to reach their fortified cities.
21 Then the Israelites returned safely to their camp at Makkedah. After that, no one dared to speak a word against Israel.
22 Then Joshua said, "Remove the rocks covering the opening of the cave and bring the five kings to me."
23 So they brought the five kings out of the cave--the kings of Jerusalem, Hebron, Jarmuth, Lachish, and Eglon.
24 Joshua told the captains of his army, "Come and put your feet on the kings' necks." And they did as they were told.
25 "Don't ever be afraid or discouraged," Joshua told his men. "Be strong and courageous, for the LORD is going to do this to all of your enemies."
26 Then Joshua killed each of the five kings and hung them on five trees until evening.
27 As the sun was going down, Joshua gave instructions for the bodies of the kings to be taken down from the trees and thrown into the cave where they had been hiding. Then they covered the opening of the cave with a large pile of stones, which remains to this very day.