Joshua made peace with them and made a treaty with them to spare their lives, and the leaders of the community swore an oath to them.