TSB has swung to a mammoth annual loss as it counted the cost of an IT meltdown last year which caused chaos for thousands of customers.

The high street lender posted a pre-tax loss of £105.4 million for 2018 compared with a profit of £162.7m the year earlier.

The disastrous migration of its IT system cost the bank £330.2m with higher charges related to customer compensation, additional resources and fraud.

Around 80,000 customers switched their bank account away from TSB in 2018 – 30,000 more than 2017. The lender currently has 3.8m current account customers and more than five million customers in total.

The bank said it had recovered £153m from IT provider Sabis.

TSB, owned by Spanish banking giant Sabadell, was stung by an IT crisis last April that left up to 1.9m users of its digital and mobile banking locked out of their accounts. The tech troubles were triggered by a migration of customer data from former owner Lloyds’ IT system to a new one managed by Sabadell.

Following the botched IT migration chief executive Paul Pester left the bank – with a payout of nearly £1.7m – and is to be replaced by CYBG’s chief operating officer Debbie Crosbie in the spring.