The proposed agreement came hours after the U.S. Department of Justice sued the state over its decades-old law.