If you've ever signed a sweet-sounding cable contract with Comcast only to find yourself surprised to be paying more in the long-run, the company may owe you money.

Comcast has agreed to pay $700,000 and to cancel some debts for more than 20,000 Massachusetts customers who may have entered into misleading agreements with the company that left them stuck with high cable bills they did not expect.

The company filed an assurance of discontinuance in Suffolk Superior Court Tuesday, part of a settlement worked out with the office of Massachusetts Attorney General Maura Healey.

"Comcast stuck too many Massachusetts customers with lengthy, expensive contracts that left many in debt and others with damaged credit," Healey said in a release. "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."

An investigation by the attorney general's office found that when Comcast advertised a $99 deal it did not disclose to customers that equipment costs and mandatory monthly fees were not included in the price. The company also failed to tell customers that fees could increase while the customer was on the "locked-in" contract.

Those fees often increased the advertised price by as much as 40 percent, according to Healey's office.

Customers, realizing the deal was not what they thought they signed up for, would additionally face early cancellation fees of up to $240, even if they were trying to downgrade to a more affordable plan, Healey's office said.

Who will Comcast be paying?

The company will provide refunds to Massachusetts customers who paid early termination fees after downgrading their cable service or who were involuntarily disconnected by the company between January 2015 and March 2016.

The company will also be forgiving any outstanding early termination fees and related late fees during the same period.

Customers don't need to do anything to get the refunds. According to the Attorney General's office, Comcast will be providing refund checks to all customers impacted and those checks should be going out within the next 60 to 90 days.

In addition, the settlement requires Comcast to change its practices going forward so that customers are aware of all disclosures before entering long-term contracts.

The settlement isn't the first of its kind for the cable company.

In 2016, Comcast agreed to pay 2.3 million in a civil penalty as part of a settlement with the federal government. It was the largest civil penalty ever assessed against a cable company.

The Federal Communications Commission said the fine was in connection to customers being charged for services and equipment they didn't ask for or even declined. The services and equipment ranged from premium channels and cable boxes to digital video recorders and other products.