Energy provider Utilita has agreed to pay £500,000 in compensation for "mistakenly overcharging" almost 40,000 pre-payment customers.
Bills were £125,000 higher than they should have been between May and September 2019, regulator Ofgem said.
Utilita has refunded all affected customers and agreed to pay a further £500,000 in redress.
Boss Bill Bullen said: "I would like to apologise unreservedly to all customers who were temporarily out of pocket
"I am sorry that we did not issue prompt refunds during the period in question.
"We know we can always improve and will always take on board criticism of any legitimate failings."
Utilita had reported itself to Ofgem, which said it would take no further action against the company.
The energy firm, which has 800,000 customers, overcharged around 6,600 prepayment customers by about £22,700 over the prepayment price cap.
It also overcharged about 33,000 customers £105,000 more than the amount they should have paid under their advertised tariff, but below the prepayment cap.
As a result Ofgem said the firm would:
- Pay a £10 goodwill payment to all existing customers who were overcharged, increasing to £15 for vulnerable circumstances
- Pay £140 to a further 900 existing customers
- And pay £45,000 into Ofgem's Voluntary Redress Fund, which backs energy related charities.
Ofgem said Utilita had accepted its shortcomings and brought in measures to prevent the issues reoccurring.
The regulator said it closely monitored suppliers' compliance with the price cap, which is designed to ensure consumers pay a fair price for their energy.
"This case sends a message to all suppliers that Ofgem will intervene if they charge customers above the level of the cap or above advertised tariffs," said director of enforcement Cathryn Scott.
Energy price comparison website Uswitch said it was "positive" to see that Utilita had agreed to compensate customers.
It added: "While the amounts overcharged would likely have been relatively small for most, it's really important that customers have confidence their supplier is charging them accurately."