Adoni-zedek, king of Jerusalem, learned that Joshua had captured Ai and destroyed the town completely, as he had also done to Jericho, and had killed its king, just as he had the king of Jericho. He also heard that the Gibeonites had made peace with the Israelites and were allied with them.