(Jeff Roberson/AP)

In what regulators are calling the largest refund in U.S. history by an Internet provider to consumers, Charter Communications has agreed to give $62.5 million — and free subscriptions to HBO or Showtime — to New York customers who allegedly didn’t receive the Internet speeds they were promised, according to New York Attorney General Barbara Underwood.

The settlement puts an end to a months-long legal battle between the state of New York and the nation’s second-largest cable company, whose subsidiary Time Warner Cable was accused of providing slow routers and modems to customers that prevented them from accessing the download speeds they had signed up for.

As many as 700,000 New Yorkers will be receiving the direct refunds. Another 2.2 million will be eligible for the free premium and streaming channels, which are collectively valued at more than $100 million, Underwood’s office said in a release.

"This settlement should serve as a wake-up call to any company serving New York consumers: Fulfill your promises, or pay the price,” said Underwood, who added that the action “sets a new standard” for corporate advertising.

Charter said the lawsuit stemmed from Time Warner Cable’s advertising practices from before the two companies merged.

“We are pleased to have reached a settlement with the Attorney General on the issue of certain Time Warner Cable advertising practices in New York prior to our merger, and to have put this litigation behind us,” Charter said in a statement. “Charter has made, and continues to make, substantial investments enhancing Internet service across the state of New York since our 2016 merger.”

Data collected by the Federal Communications Commission show that about 93 percent of Charter’s customers nationwide receive a median download speed that is on par with their advertised speed tier.

But many New Yorkers had complained that they were in the minority of users who were being left behind. Although Time Warner Cable had marketed speeds of up to 300 Mbps, subscribers to those and other plans suffered through stuttering on Netflix and other streaming services as the broadband network failed to deliver enough capacity to serve a smooth connection, New York alleged in its 2017 lawsuit.

As part of the settlement, Charter will give for free either three months of HBO or six months of Showtime to New York customers who don’t already pay for the channels themselves through their monthly bill. Each of the direct refunds will amount to $75 per affected subscriber, while as many as 150,000 customers will receive an additional $75 for having lived with an “inadequate” modem for two years or more.

New York and Charter have had a difficult relationship since the merger with Time Warner Cable. State officials have taken aim at Charter for failing to live up to other commitments it made during the merger process; for example, the New York Public Service Commission has alleged that Charter dragged its feet in building out Internet access to underserved homes in New York.

In July, the commission sought to unwind the Charter-Time Warner Cable merger entirely, after arguing that Charter had sought to satisfy its build-out commitments by connecting households in New York City rather than rural Upstate. At the time, Charter responded that it had extended its broadband network to 86,000 New York homes and suggested that the commission’s effort to break up the company may have been politically motivated. That case is separate from Underwood’s announcement.