Yui Mok - PA Images

EE and Virgin Media were slapped with a combined £13.3 million ($17 million) fine for overcharging phone and broadband customers who wanted to leave their contracts early, Ofcom announced Friday.

The UK communications regulator said neither telecoms company made the charges for failing to see out the minimum contract term sufficiently clear, breaching consumer protection rules.

About 400,000 EE customers were overbilled for ending their contracts early -- those customers ended up overpaying up to £4.3 million total -- and almost 82,000 Virgin Media customers were overcharged nearly £2.8 million.

"These fines send a clear message to all phone and broadband firms that they must play by the rules, in the interests of their customers," Gaucho Rasmussen, Ofcom's director of investigations and enforcement, said in a release.

EE was fined £6.3 million and agreed to significantly reduce its charges along with refunding more than £2.7 million to affected customers it's been able to identify. This means £1.6 million can't be refunded.

"We accept Ofcom's findings and recognise that we have made a mistake," a company spokesperson said in a emailed statement. "We apologise to customers with discounted tariffs who paid more than they should have when cancelling their contracts early."

Virgin Media was hit for £7 million, along with an additional £25,000 for its failure to provide incomplete information, and has reduced its early-exit charges by an average of 30 percent. It's also reimbursed or made donations to charity for more than 99.8 percent of impacted customers.

It slammed the fine as "both unjustified and disproportionate," noting that it'll appeal Ofcom's decision.

"This unreasonable decision and excessive fine does not reflect the swift actions we took, the strong evidence we have presented, or our consistent, open and transparent cooperation with the regulator," said Tom Mockridge, Virgin Media's CEO, in a release.

First published at 3:21 a.m. PT.

Updated at 3: 51 a.m. PT: Adds EE and Virgin Media statements.

CNET's Holiday Gift Guide: The place to find the best tech gifts for 2018.

Best Black Friday 2018 deals: The best discounts we've found so far.