Now it came about when Adoni-zedek king of Jerusalem heard that Joshua had captured Ai, and had utterly destroyed it (just as he had done to Jericho and its king, so he had done to Ai and its king), and that the inhabitants of Gibeon had made peace with Israel and were within their land, that 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 mighty. Therefore Adoni-zedek king of Jerusalem sent word to Hoham king of Hebron and to Piram king of Jarmuth and to Japhia king of Lachish and to Debir king of Eglon, saying, “Come up to me and help me, and let us attack Gibeon, for it has made peace with Joshua and with the sons of Israel.” 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 together and went up, they with all their armies, and camped by Gibeon and fought against it.
Then the men of Gibeon sent word to Joshua to the camp at Gilgal, saying, “Do not abandon your servants; come up to us quickly and save us and help us, for all the kings of the Amorites that live in the hill country have assembled against us.” So Joshua went up from Gilgal, he and all the people of war with him and all the valiant warriors. The Lord said to Joshua, “Do not fear them, for I have given them into your hands; not one of them shall stand before you.” So Joshua came upon them suddenly by marching all night from Gilgal. And the Lord confounded them before Israel, and He slew them with a great slaughter at Gibeon, and pursued them by the way of the ascent of Beth-horon and struck them as far as Azekah and Makkedah. As they fled from before Israel,while they were at the descent of Beth-horon, the Lord threw large stones from heaven on them as far as Azekah, and they died; there were more who died from the hailstones than those whom the sons of Israel killed with the sword.
Then Joshua spoke to the Lord in the day when the Lord delivered up the Amorites before the sons of Israel, and he said in the sight of Israel,
“O sun, stand still at Gibeon,
And O moon in the valley of Aijalon.”
So the sun stood still, and the moon stopped,
Until the nation avenged themselves of their enemies.
Is it not written in the book of Jashar? And the sun stopped in the middle of the sky and did not hasten to go down for about a whole day. There was no day like that before it or after it, when the Lord listened to the voice of a man; for the Lord fought for Israel.