Now these are the nations which the LORD left, that He might test Israel by them, that is, all who had not known any of the wars in Canaan (this was only so that the generations of the children of Israel might be taught to know war, at least those who had not formerly known it), namely, five lords of the Philistines, all the Canaanites, the Sidonians, and the Hivites who dwelt in Mount Lebanon, from Mount Baal Hermon to the entrance of Hamath. And they were left, that He might test Israel by them, to know whether they would obey the commandments of the LORD, which He had commanded their fathers by the hand of Moses.
Thus the children of Israel dwelt among the Canaanites, the Hittites, the Amorites, the Perizzites, the Hivites, and the Jebusites. And they took their daughters to be their wives, and gave their daughters to their sons; and they served their gods.
So the children of Israel did evil in the sight of the LORD. They forgot the LORD their God, and served the Baals and Asherahs. Therefore the anger of the LORD was hot against Israel, and He sold them into the hand of Cushan-Rishathaim king of Mesopotamia; and the children of Israel served Cushan-Rishathaim eight years. When the children of Israel cried out to the LORD, the LORD raised up a deliverer for the children of Israel, who delivered them: Othniel the son of Kenaz, Caleb’s younger brother. The Spirit of the LORD came upon him, and he judged Israel. He went out to war, and the LORD delivered Cushan-Rishathaim king of Mesopotamia into his hand; and his hand prevailed over Cushan-Rishathaim.