Royal Bank of Scotland has reported a £2.04 billion loss for the first half of the year after racking up £1.3 billion worth of PPI and other legal costs.

The state-backed lender, 73% owned by the taxpayer, has put aside £450 million to cover payment protection insurance (PPI) claims after the Financial Conduct Authority extended the deadline to 2019 earlier this week.

RBS was also stung by £630 million in restructuring costs and a similar figure for litigation brought by shareholders linked to its bailout.

The losses, which have ballooned from £179 million last year, also reflect the impact of its £1.2 billion payment to the Treasury to buy out a crucial part of its £45 billion bailout.

The bank also abandoned plans to separate the Williams & Glyn branch network because of the complexities and costs associated with creating a new banking platform. However, RBS remains committed to selling Williams & Glyn, with Santander understood to be interested in picking it up.

He said: "We are clearly in phase two of our strategy, where our focus is on drawing a line under many of the legacy issues that have plagued this bank, and transforming the core business so we can deliver consistent, sustainable profits and results for our shareholders and do great things for our customers."

The bank's core business reported a £1 billion adjusted operating profit in the second quarter, rising to £2 billion in the half-year.

"This progress is important because it means we are well positioned to support our customers through the challenges that an economic slowdown poses for the country," Mr McEwan added.

However, RBS also warned that Britain's decision to quit the European Union could hit the bank.

"The outcome of the UK's EU referendum has created considerable uncertainty in our core market and we continue to assess all its implications.

"In the current low rate and low growth environment, achieving our longer term cost:income ratio and return targets by 2019 is likely to be more challenging."

The chief executive also appeared to address Bank of England governor Mark Carney's warning that banks have "no excuse" to stop lending following the decision to cut interest rates and launch a package of measures to support bank lending.

"We have been the fastest-growing large UK bank - with net lending into the UK economy higher than any other bank in the first half of the year. We are open for business, ready to lend, and ready to play our part in this new chapter for the country," Mr McEwan said.

For the second quarter, RBS's loss was £1 billion, with the firm booking a 118 million euro (£99.3 million) provision linked to Irish tracker mortgages in the period.