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.
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.
But at the same time he made them slaves, to cut wood and carry water for the people of Israel and for the Lord's altar. To this day they have continued to do this work in the place where the Lord has chosen to be worshiped.