Judges 3:4-8
Judges 3:4-8 AMP
They were [allowed to remain] for the testing of Israel, to determine whether Israel would listen to and obey the commandments of the LORD, which He had commanded their fathers (ancestors) through Moses. And the Israelites lived among the Canaanites, Hittites, Amorites, Perizzites, Hivites, and Jebusites; and they took their daughters for themselves as wives and gave their own daughters to their sons, and served their [pagan] gods. [Ex 34:12-16] And the Israelites did evil in the sight of the LORD, and they forgot the LORD their God and served the Baals and the Asheroth. [Judg 2:13] So the anger of the LORD was kindled against Israel, and He sold them into the hand of Cushan-rishathaim king of Mesopotamia; and the Israelites served Cushan-rishathaim eight years.