ALBANY — "Game of Thrones" for everyone.

Well, not quite everyone — but a large number of Spectrum TV and internet customers will get free HBO or Showtime as part of a $174 million settlement that state Attorney General Barbara Underwood negotiated with Charter Communications over internet speeds.

And they should get it just in time for the eighth and final season of the popular fantasy HBO series about warring kingdoms in a pre-digital age.

Under the deal announced by Underwood on Tuesday, Charter will provide $62.5 million in direct refunds to 700,000 Spectrum internet customers who had inadequate modems or routers for the internet speeds promised by the Time Warner Cable, which sold its upstate New York network to Charter in 2016. Charter operates the network under the Spectrum name and has 2.2 million customers in the state.

Some customers will get $75. Others will get $150 if they had inadequate service for two years or more.

Charter will also provide either three months of HBO or six months of Showtime at no cost to Spectrum customers who get both TV and internet and do not currently get both premium channels.

The rest of Spectrum's internet customers will be offered a free month of Spectrum's new streaming TV service, which includes local broadcast and 10 paid channels, with free Showtime thrown in during that time. Normally, that service costs about $23 a month.

The AG's investigation initially examined whether Time Warner Cable's internet speeds were as fast as it claimed.

After Charter acquired the upstate network, the AG's office sued the company in 2017 in state Supreme Court. Charter's attempts to get the case dismissed or moved to federal court were denied several times before Tuesday's settlement that was struck.

"This settlement should serve as a wake-up call to any company serving New York consumers: Fulfill your promises, or pay the price," Underwood said in a statement. "Not only is this the largest-ever consumer payout by an internet service provider — returning tens of millions of dollars to New Yorkers who were ripped off and providing additional streaming and premium channels as restitution – but it also sets a new standard for how internet providers should fairly market their services."

Charter says the AG's investigation was triggered by Time Warner Cable's practices before the merger, and that it has significantly increased minimum internet speeds in New York since taking ownership.

"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 spokesman Andrew Russell said Tuesday. "Charter has made, and continues to make, substantial investments enhancing internet service across the state of New York since our 2016 merger, as acknowledged by the attorney general in this settlement."

The deal is separate from a long-running feud between the state Public Service Commission and Charter over whether the company is living up to the conditions of the PSC's approval of the Time Warner Cable deal.

"The PSC has repeatedly expressed concerns about Charter's conduct as reflected in our public filings and today's settlement only reinforces that fact," PSC spokesman James Denn said Tuesday. "These claims are independent from Charter's failure to meet its obligations to expand broadband services across the state, which is why the Public Service Commission will continue holding the company accountable for that failure."

One of the main requirements of the Time Warner Cable merger approval by New York regulators was that Charter expand its Spectrum network to 145,000 new households and businesses in under-served areas of the state.

However, the PSC has contended that Charter has failed to live up to the requirement by including addresses from New York City and other densely populated areas in its tally instead of expansions to homes in rural areas — where the need is greatest but the construction costs are much higher.

In July, the PSC took the unprecedented step of revoking its 2015 approval of Charter's acquisition of Time Warner Cable's New York operations. It also ordered Charter to come up with a plan to sell the Spectrum system to another provider.

The two sides have been in negotiations ever since to try come up with a compromise that would keep Charter in New York, although Charter has claimed the damage is already done as competitors like Verizon have taken advantage of Charter being in regulatory limbo.

Under the terms of Tuesday's settlement, Charter has 120 days to refund customers and inform them how to access their free programming. That's just in time for customers to get free access to the eighth and final season of HBO's "Game of Thrones" series that is slated to start in April.

Charter doesn't have an exact date when customers should expect to be notified if they are eligible.

Charter is also required under the settlement to make other changes to its advertising claims, the type of equipment it provides and its sales training techniques.

One of the biggest issues examined in the investigation is how advertised internet speeds can slow down between the "wired" connection into the house and wifi routers that broadcast internet connections to wireless devices and video game consoles.