Energy supplier E.On Next has been told to pay out £5million in compensation over poor customer service.
Ofgem said it had uncovered "severe weaknesses" with customers facing long call waiting times of 18 minutes on average.
Many customers were unable to get through to E.On Next at all, with Ofgem data showing a high number of unanswered calls.
Ofgem said there was “an unacceptable” call drop-off rate with 50% of customer calls failing to successfully contact the supplier.
More than 500,000 customers were potentially affected.
The regulator said E.On Next will pay £4million to customers, working out at £8 each.
It will also pay a further £1million to the Ofgem voluntary redress fund, which supports vulnerable energy consumers.
Cathryn Scott, director for enforcement and emerging issues at Ofgem, said: "The very least that a customer should expect of their supplier is for them to pick up the phone to them in a timely way.
"The levels of service that we discovered at E.On Next during the period of review were unacceptable.
"As the energy regulator, our purpose is to protect energy consumers and this action serves as a reminder to all suppliers that they must ensure that their customers are able to contact them quickly and easily when they need to.
"This is particularly important during this time of volatile energy prices when many households are struggling with their bills."
Ofgem said E.On Next has started addressing the issues and call waiting times having reduced to an average of less than five minutes, and call drop-off rates to below 10%.
An E.On Next spokesperson said: "We had invested in improving our services even before Ofgem began its review, prioritising our most vulnerable customers with specialist teams and recruiting hundreds more energy specialists to be there for customers when they need us.
"We won't shy away from the fact that we weren't at our best but we're heartened Ofgem recognises our efforts and our success in improving service levels even before this review began."
The news comes as the Ofgem price cap is due to fall to £2,074 for a typical household per year from July.