Restitution is coming.

After experiencing years of buffering beach balls, price gouging and righteously rude service in New York state, at least 2 million customers of Charter Communications, formerly Time Warner Cable, will get sweet revenge, thanks to the New York attorney general, Barbara Underwood.

An investigation found that the company had cheated customers by falsely advertising internet speeds beyond its capability.

In announcing a settlement Tuesday, the attorney general’s office said it was the largest consumer payout by an internet service provider in U.S. history: $62.5 million paid directly to customers, with a total market value of $174.2 million.

Within the next three months, more than 700,000 active customers will get a $75 refund, plus their choice of premium cable channels — six free months of Showtime or three free months of HBO. (“Game of Thrones” is set to start its final season in April.)

Approximately 2.2 million internet subscribers will be eligible for video and streaming services; these services, combined with the premium channels, are valued at more than $100 million dollars, the attorney general said. Another 150,000 customers who suffered with an “inadequate modem” for 24 months will get an additional $75 refund.

Under the settlement, Charter will also have to declare the proper speeds of its service, with regular monitoring.

“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 about the deal, which was first reported by The Daily News.

Charter Communications merged with Time Warner in 2016, and has rebranded the internet, phone and cable service as Spectrum Cable. A spokesman for Charter, John Bonomo, emphasized that Charter had inherited the poor internet service from Time Warner.

“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,” he said in a statement.

The attorney general’s office acknowledged that since the investigation concluded, “Charter made significant investments to address the problems identified in the complaint and improve internet service in New York. This includes network enhancements, modem replacements and upgraded Wi-Fi routers.”

The payouts were hard fought. Since the former attorney general, Eric T. Schneiderman, announced the civil suit in February 2017, Charter sought to move the case to federal court. But the attorney general’s office won a decision that returned it to state court.

Charter tried to have the case dismissed, to no avail, and ultimately lost its argument in an appeals court, paving the way for the settlement.