When they put away their foreign gods and served the LORD, he brought Israel's misery to an end. 