Joshua made a treaty of friendship with the people of Gibeon and allowed them to live. The leaders of the community of Israel gave their solemn promise to keep the treaty.
The people of Gibeon were not Israelites; they were a small group of Amorites whom the Israelites had promised to protect, but Saul had tried to destroy them because of his zeal for the people of Israel and Judah.)
Adonizedek, the king of Jerusalem, heard that Joshua had captured and totally destroyed Ai and had killed its king, just as he had done to Jericho and its king. He also heard that the people of Gibeon had made peace with the Israelites and were living among them.