Energy supplier E.ON has been forced to hand over £1.7m to customers after it was caught overcharging.
The company hit around 94,000 UK customers with either higher exit fees than necessary or overcharged them following price rises.
The compensation payment agreed with the energy regulator Ofgem includes a £300,000 payment to a consumer fund which E.ON runs in partnership with the charity Age UK.
Sarah Harrison, the regulator's enforcement chief, said: "Ofgem has put in place protections for consumers so they can get a fair warning if their supplier puts up prices and time to shop around for a better deal.
"E.ON has accepted it failed to meet these protections. Today's announcement that E.ON will compensate customers is a positive step by the company to put right their mistakes."
The German-owned company came in for criticism this summer after it announced a 24 per cent rise in half-year UK profits.
It made £245m between January and June, up from £198m over the same period in 2011.
Meanwhile home energy bills have been soaring, although E.ON agreed to fix its standard tariff until the end of the year.
It has kept to that, although is expected to announce a price hike of around 10 per cent early next month.
The company blamed the overcharging on a computer glitch after it raised prices for domestic customers in 2011.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies