Scottish Power has been fined £18m for poor customer service issues.
Ofgem say the firm failed to treat its customers fairly, with inadequate call handling, complaint resolution and billing. Some 300,000 customers received late bills.
The £18m will be paid to vulnerable customers and charity.
Ofgem said Scottish Power had improved its customer service and co-operated during the investigation but the penalty is the third-largest imposed by the regulator. It comes just months after Npower was ordered to pay £26m for sending out inaccurate bills and failing to deal with complaints correctly
Ofgem chief executive Dermot Nolan said: "Scottish Power let its customers down during the implementation of a new IT system. When things went wrong, it didn't act quickly enough to fix them. This created frustration and worry for many customers, who also wasted a lot of time trying to contact the supplier by phone.
"The £18m payment sends a strong message to all energy companies about the importance of treating consumers well at all times, including while new systems are put in place."
Neil Clitheroe, Scottish Power's head of energy retail and generation, said: "Scottish Power has worked with Ofgem throughout this investigation. We apologise unreservedly to those customers affected.
"In order to upgrade our old IT systems, we invested £200m on new technology to allow us to deliver smarter digital products and services to benefit our customers.
"During the complex transition between systems we encountered a range of technical issues. This led to an unacceptable increase in complaints and reduced the quality of our customer service.
"I gave a guarantee that no customer would be left out of pocket by these issues and we continue to compensate customers who have been affected."
Ofgem said that Scottish Power had improved its customer service since its investigation had begun.
It said the average call waiting time, the rate of abandoned calls and the number of Ombudsman cases had all more than halved. In addition, the number of late bills had fallen by three-quarters.