Adoni-zedek, king of Jerusalem, heard that Joshua had captured and completely destroyed Ai and killed its king, just as he had destroyed the town of Jericho and killed its king. He also learned that the Gibeonites had made peace with Israel and were now their allies.