1 King Adoni-zedek of Jerusalem eventually heard how Joshua had conquered Ai, utterly destroying it, doing to Ai and its king the same thing that he had done to Jericho and its king, and how the inhabitants of Gibeon had made peace with Israel and were now living among them. 2 So they were terrified, since Gibeon was a large city, comparable to one of the royal cities, was larger than Ai, and all of its men had been warriors. 3 So King Adoni-zedek of Jerusalem sent word to King Hoham of Hebron, King Piram of Jarmuth, King Japhia of Lachish, and King Debir of Eglon. He told them, 4 "Come over and help me, and let's attack Gibeon, because it made a peace treaty with Joshua and the Israelis." 5 So the five kings of the Amorites the king of Jerusalem, the king of Hebron, the king of Jarmuth, the king of Lachish, and the king of Eglon gathered their armies together and advanced with all of their armies toward Gideon, camped there, and laid siege to it.
6 The Gibeonites sent word to Joshua at his camp in Gilgal: "Don't abandon your servants. Come quickly, save us, and help us, because all of the kings of the Amorites who live in the hill country have attacked us." 7 So Joshua went up from Gilgal, along with his entire fighting force of mighty warriors with him.
8 The LORD told Joshua, "Don't fear them, because I have handed them over to you. Not one of them will withstand you."
9 So after an all-night march from Gilgal, Joshua attacked them by surprise. 10 The LORD threw the Amorites into a panic right in front of the army of Israel, which then slaughtered many of them at Gibeon. The Israeli army chased them along the road that goes up to Beth-horon, striking them down as far as Azekah and Makkedah. 11 While they were fleeing in front of Israel and descending the slope of Beth-horon, the LORD rained down huge hailstones on them as far as Azekah, and they died. More died because of the hailstones than were killed by the Israelis in battle.
12 Later that day, Joshua spoke to the LORD while the LORD was delivering the Amorites to the Israelis. This is what he said in the presence of Israel: "Sun, be still over Gibeon! Moon, stand in place in the Aijalon Valley!" 13 So the sun remained still and the moon stood in place until the nation settled their score with their enemies. This is recorded, is it not, in the book of Jashar? The sun stood in place in the middle of the sky and seemed not to be in a hurry to set for nearly an entire day.
14 There has never been a day like it before or since, when the LORD listened to the voice of a man, because the LORD was fighting on behalf of Israel. 15 After this, Joshua returned to the camp at Gilgal with the entire fighting force of Israel.
16 Meanwhile, the five kings had fled and hidden themselves inside a cave at Makkedah. 17 Joshua was informed, "The five kings have been discovered hiding in the cave at Makkedah."
18 So Joshua gave an order, "Roll large stones up against the mouth of the cave and assign men to stand guard there, 19 but don't stay there yourselves. Instead, pursue your enemies and attack them from behind. Don't allow them to enter their cities, because the LORD your God has delivered them into your control." 20 Now it came about that after Joshua and the Israelis had finished the battle, destroying and scattering their survivors, who retreated into their fortified cities, 21 the entire army returned safely to Joshua's encampment at Makkedah. No one could speak so much as a single word against any of the Israelis.
22 Then Joshua gave this order: "Unseal the mouth of the cave and bring out these five kings to me from the cave." 23 So they did. They brought out these five kings to him from within the cave: the king of Jerusalem, the king of Hebron, the king of Jarmuth, the king of Lachish, and the king of Eglon. 24 When they had brought these kings out to Joshua, Joshua called for all the men of Israel and spoke to the leaders of the men who had gone out to war along with him, "Come close and put your feet on the necks of these kings." So they came near and put their feet on their necks. 25 Joshua told the army, "Don't fear or be dismayed! Be strong and courageous, because this is how the LORD will treat all of your enemies whom you fight."
26 After this, Joshua struck those kings down, executing them, and hanged them on five gallows until sunset. 27 When evening had come, Joshua gave a command to remove the bodies from the gallows and bury them in the cave where they had hidden. The army sealed the mouth of the cave with large stones that remain there to this very day.
28 Joshua captured Makkedah that very day, and attacked both it and its king with swords, utterly destroying it along with every person in it, leaving no survivors. He dealt with the king of Makkedah the same way he had dealt with the king of Jericho.
29 Afterward, Joshua and all of Israel passed on from Makkedah to Libnah, where they fought against Libnah. 30 The LORD gave both it and its king into the control of Israel, and Joshua executed both its king and every person in it with swords, leaving no survivors. He dealt with the king the same way he had dealt with the king of Jericho.
31 Then Joshua and all of Israel passed from Libnah to Lachish, camped near it, and attacked it. 32 The LORD gave Lachish into the control of Israel, and Joshua captured it the next day. He declared war on the city and executed everyone in it, the same way he had treated Libnah. 33 Then Horam king of Gezer appeared to help Lachish. So Joshua attacked him and his army, until he left no one remaining.
34 After this, Joshua, accompanied by all of Israel, proceeded from Lachish to Eglon, laid siege to it, and attacked it. 35 They captured it on that day, attacking it in battle. Then Joshua completely destroyed it that day, the same way he had dealt with Lachish.
36 Then Joshua, accompanied by all of Israel, left Eglon for Hebron, where they attacked it, 37 captured it, and executed its inhabitants its king, all of its cities, and every person in it, leaving no one remaining, the same way he had dealt with Eglon. He completely destroyed it, along with everyone in it.
38 Then Joshua returned, accompanied by the entire fighting force of Israel, to Debir, where they attacked it, 39 captured it, its king, and all of its villages. They executed them, totally destroying it and everyone in it, leaving no one remaining. He dealt with Debir and its king just as he had dealt with Hebron, treating them the same way he had dealt with Libnah and its king.
40 So Joshua conquered the entire land, the hill country, the Negev, the Shephelah, and the wilderness highlands, along with all of their kings. He left none of them remaining, but completely destroyed every living person, just as the LORD God of Israel had commanded. 41 Joshua conquered them from Kadesh-barnea to Gaza, including the entire territory of Goshen as far as Gibeon. 42 Joshua conquered all of these kings and their territories in one campaign, because the LORD God of Israel fought for Israel. 43 Then Joshua returned to the camp at Gilgal, along with the entire fighting force of Israel.