10:1 As soon as Adoni-zedek, king of Jerusalem, heard how Joshua had captured Ai and had devoted it to destruction, doing to Ai and its king as he had done to Jericho and its king, and how the inhabitants of Gibeon had made peace with Israel and were among them, 2 he feared greatly, because Gibeon was a great city, like one of the royal cities, and because it was greater than Ai, and all its men were warriors. 3 So Adoni-zedek king of Jerusalem sent to Hoham king of Hebron, to Piram king of Jarmuth, to Japhia king of Lachish, and to Debir king of Eglon, saying, 4 “Come up to me and help me, and let us strike Gibeon. For it has made peace with Joshua and with the people of Israel.” 5 Then 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 forces and went up with all their armies and encamped against Gibeon and made war against it.
6 And the men of Gibeon sent to Joshua at the camp in Gilgal, saying, “Do not relax your hand from your servants. Come up to us quickly and save us and help us, for all the kings of the Amorites who dwell in the hill country are gathered against us.” 7 So Joshua went up from Gilgal, he and all the people of war with him, and all the mighty men of valor. 8 And the Lord said to Joshua, “Do not fear them, for I have given them into your hands. Not a man of them shall stand before you.” 9 So Joshua came upon them suddenly, having marched up all night from Gilgal. 10 And the Lord threw them into a panic before Israel, who struck them with a great blow at Gibeon and chased them by the way of the ascent of Beth-horon and struck them as far as Azekah and Makkedah. 11 And as they fled before Israel, while they were going down the ascent of Beth-horon, the Lord threw down large stones from heaven on them as far as Azekah, and they died. There were more who died because of the hailstones than the sons of Israel killed with the sword.
12 At that time Joshua spoke to the Lord in the day when the Lord gave the Amorites over to the sons of Israel, and he said in the sight of Israel,
“Sun, stand still at Gibeon,
and moon, in the Valley of Aijalon.”
13 And the sun stood still, and the moon stopped,
until the nation took vengeance on their enemies.
Is this not written in the Book of Jashar? The sun stopped in the midst of heaven and did not hurry to set for about a whole day. 14 There has been no day like it before or since, when the Lord heeded the voice of a man, for the Lord fought for Israel.
15 So Joshua returned, and all Israel with him, to the camp at Gilgal.
16 These five kings fled and hid themselves in the cave at Makkedah. 17 And it was told to Joshua, “The five kings have been found, hidden in the cave at Makkedah.” 18 And Joshua said, “Roll large stones against the mouth of the cave and set men by it to guard them, 19 but do not stay there yourselves. Pursue your enemies; attack their rear guard. Do not let them enter their cities, for the Lord your God has given them into your hand.” 20 When Joshua and the sons of Israel had finished striking them with a great blow until they were wiped out, and when the remnant that remained of them had entered into the fortified cities, 21 then all the people returned safe to Joshua in the camp at Makkedah. Not a man moved his tongue against any of the people of Israel.
22 Then Joshua said, “Open the mouth of the cave and bring those five kings out to me from the cave.” 23 And they did so, and brought those five kings out to him from the cave, the king of Jerusalem, the king of Hebron, the king of Jarmuth, the king of Lachish, and the king of Eglon. 24 And when they brought those kings out to Joshua, Joshua summoned all the men of Israel and said to the chiefs of the men of war who had gone with him, “Come near; put your feet on the necks of these kings.” Then they came near and put their feet on their necks. 25 And Joshua said to them, “Do not be afraid or dismayed; be strong and courageous. For thus the Lord will do to all your enemies against whom you fight.” 26 And afterward Joshua struck them and put them to death, and he hanged them on five trees. And they hung on the trees until evening. 27 But at the time of the going down of the sun, Joshua commanded, and they took them down from the trees and threw them into the cave where they had hidden themselves, and they set large stones against the mouth of the cave, which remain to this very day.
28 As for Makkedah, Joshua captured it on that day and struck it, and its king, with the edge of the sword. He devoted to destruction every person in it; he left none remaining. And he did to the king of Makkedah just as he had done to the king of Jericho. (ESV)