British Gas has paid out £2.65 million in refunds, compensation and redress after wrongly overcharging customers and putting them on more expensive tariffs.
Ofgem's investigation found the Big Six supplier overcharged more than 94,000 customers a total of £782,450 after they decided to switch suppliers due to a system error.
Instead of extending the fixed-term contracts of these customers, British Gas rolled them onto its more expensive variable tariff.
It also provided 2.5 million customers with incorrect terms and conditions, which stated exit fees were payable during the 49 day period before their fixed deal expired.
However, under Ofgem's switching rules, customers do not have to pay an exit fee when switching if they are in the last 49 days of their fixed deal expired.
British Gas wrongly charged 1,698 of its fixed-deal customers a total of £64,968 when they switched suppliers during that time frame.
Ofgem said that British Gas refunded all its customers who had been overcharged by more than £1 and paid £502,633 in compensation to them before its investigation concluded.
Following Ofgem's findings, British Gas agreed to pay a further £244,770 in compensation to customers who were wrongly charged exit fees and the standard variable tariff and pay more than £1 million into the regulator's consumer redress fund.
Centrica said a system error led to a small proportion of customers being incorrectly charged.
If you are a customer of British Gas, and would like to see your options, check out here to see what you could save off your energy bills.