Adoni-Zedek was the king of Jerusalem. He heard that Joshua had taken Ai. He found out that the city had been set apart to the LORD in a special way to be destroyed. He heard that Joshua had done to Ai and its king the same thing he had done to Jericho and its king. Adoni-Zedek heard that the people of Gibeon had made a peace treaty with Israel. He also found out that they were living among the people of Israel.
The things he heard alarmed him and his people very much. That's because Gibeon was an important city. It was like one of the royal cities. It was larger than Ai. All of its men were good soldiers.
So Adoni-Zedek, the king of Jerusalem, made an appeal to Hoham, the king of Hebron. He appealed to Piram, the king of Jarmuth. He appealed to Japhia, the king of Lachish. He also made an appeal to Debir, the king of Eglon.
"Come up and help me attack Gibeon," he said. "Its people have made peace with Joshua and the people of Israel."
The kings of Jerusalem, Hebron, Jarmuth, Lachish and Eglon gathered their armies together. Those five Amorite kings moved all of their troops into position to fight against Gibeon. Then they attacked it.
Joshua was in the camp at Gilgal. The people of Gibeon sent a message to him there. It said, "Don't desert us. We serve you. Come up to us quickly! Save us! Help us! All of the Amorite kings from the central hill country have gathered their armies together to fight against us."
So Joshua marched up from Gilgal with his whole army. The army included all of his best fighting men.
The LORD said to Joshua, "Do not be afraid of them. I have handed them over to you. Not one of them will be able to fight against you and win."
Joshua marched all night from Gilgal. He took the Amorite armies by surprise.
The LORD threw them into a panic as Israel marched toward them. Then Israel won a great battle over them at Gibeon. They chased them along the road that goes up to Beth Horon. They struck them down all the way to Azekah and Makkedah.