CenturyLink, the nation’s third-largest telecom company, has agreed to pay $8.9 million to tens of thousands of customers in Minnesota who were allegedly overcharged, state Attorney General Keith Ellison announced Wednesday.

The settlement also requires the company to reform its billing practices by disclosing its true prices, honoring all promised prices and discounts, and banning what officials deemed “sham internet fees.” Under the terms of the agreement, CenturyLink also is required to submit audits to the Attorney General’s Office for the next three years.

“There’s no amount of money that can fully reimburse every Minnesotan that CenturyLink defrauded for all the money they were overcharged and all the time they lost in trying to get CenturyLink to do the right thing in the first place,” Ellison said. “Even so, this settlement will put money back into the pockets of thousands of Minnesotans.”

The payments are to be broken out into two chunks: more than $844,000 in refunds to more than 12,000 Minnesota customers promised discounts they never received, and more than $8 million to Ellison’s office to be distributed to other affected customers.

Mark Molzen, a spokesman for CenturyLink, said the company disputes Ellison’s allegations but agreed to a settlement to end the case. “We believe it is in the best interests of our company and our customers to amicably resolve these matters,” Molzen said. The settlement, he added, also will “avoid the distraction and costs of litigation.”

As part of the deal, CenturyLink must disclose the true price of services in advertisements and at the time of sale provide customers with order confirmations detailing how much they will pay, honor all prices and discounts promised to consumers, and stop charging what the Attorney General’s Office described as fraudulent internet fees that provide nothing of value.

“This is really a 180 from how they’ve done business before,” Assistant Attorney General Alex Baldwin told reporters Wednesday. “It’s on them to prove you wrong if you think they are charging you more.”

Ellison said his office has received more than 5,000 complaints about CenturyLink from Minnesota consumers, adding that it was the most commonly cited company in his office’s consumer database. All told, Ellison said, CenturyLink may have overbilled more than 300,000 Minnesotans. His office is asking Minnesotans who believe they were overbilled anytime since July 12, 2011, to contact the office at 651-296-3353 in the metro area or 800-657-3787 elsewhere in the state.

Minnesota is the only state to bring claims in court against the company so far. But Ellison said his office has shared information with attorneys general in other states, leading to additional settlements in Colorado, Oregon and Washington.