BOSTON (CBS) – More than 20,000 Comcast customers in Massachusetts will get a refund or have their debt with the cable company canceled, Attorney General Maura Healey announced Tuesday.

Healey said in a statement that Comcast is settling a lawsuit that alleged the company “violated state consumer protection laws by using deceptive advertisements to promote its long-term cable contracts.”

READ MORE: Watch Live @ 8:30 am: Baker Visits Newburyport School's Pool COVID-19 Testing Program

Comcast allegedly left customers stuck in agreements they couldn’t afford, and didn’t properly disclose fees that raised bills 40 percent above the advertised price, according to Healey. When customers tried to cancel, they were charged early termination fees of up to $240.

READ MORE: 582 At Massachusetts Schools Test Positive For COVID-19 In Last 2 Weeks

“Comcast stuck too many Massachusetts customers with lengthy, expensive contracts that left many in debt and others with damaged credit,” Healey said. “Customers have a right to clear information about the products and services they buy. This settlement should encourage the entire cable and telecommunications industry to take a close look at their advertisements and make sure customers are getting a fair offer.”

As part of the settlement, Comcast is refunding Bay State customers who paid early termination fees between January 2015 and March 2016. Anyone who has not paid termination or late fees charged between that time will have their debt forgiven.

MORE NEWS: Friday Marks First Anniversary Of Boston Biogen Conference Super Spreader Event

Comcast is now being ordered to improve its disclosure of hidden fees, including training its employees to acknowledge the “true monthly services prices” to customers before they sign a contract.