Losses at Royal Bank of Scotland (RBS) unexpectedly widened in the second quarter following restructuring costs and hefty provisions for litigation and consumer compensation.

The bank, in which the government holds almost 72% of the voting rights after a credit-crisis bailout, posted a £1.1 billion ($1.4 billion) loss attributable to shareholders. That's up on a loss of £968 million in the first quarter, when Royal Bank of Scotland paid the government £1.2 billion to remove a constraint on its ability to pay dividends to other shareholders in the future.

It compares with a profit attributable to shareholders of £280 million in the second quarter of last year and with consensus expectations as published by FactSet for a second-quarter loss of £410 million. Royal Bank's net interest margin came in at 2.21% in the second quarter, up from 2.15% in the first quarter but below the 2.34% FactSet consensus.

RBS said "market conditions have become more uncertain" following the U.K.'s Brexit result, with new mortgage applications notably dipping. As a result it said it would be more challenging to reach targets for its cost-to-income ratio and for returns that it has set for 2019. For 2016 it said it may not be able to cut risk-weighted assets as fast as expected.

However, it stood by a £800 million 2016 cost reduction target and it upgraded its full-year forecast for its corporate and institutional banking business, saying it now expects the unit's income to be "stable," compared with the "mild erosion" it had predicted in the first quarter. It still expects income from personal and business banking and from commercial and private banking to be "broadly stable."

In the quarter RBS said it took £392 million of restructuring charges, well over double the first-quarter total, including for Williams & Glyn, the name it's given to the 300 branches that the European Commission has said it must sell by the end of 2017 in return for clearance of its 2009 government bailout. Litigation and conduct costs spiraled to £1.28 billion from £31 million in the first quarter, including additional provisions for compensation due customers for missold payment protection insurance and funds set aside to cover a class action related to a pre-bailout rights issue in 2008.

In the quarter, adjusted operating profit across RBS' three businesses - personal and business banking; commercial and private banking; and corporate and institutional banking -  totaled £1.05 billion, down £174 million year-on-year but up £24 million from the first quarter.

Corporate and institutional banking was a bright spot, swinging to a profit following losses in the first quarter and a year earlier.

RBS also said it had held "positive discussions" with parties interested in buying Williams & Glyn but said the talks were preliminary and may not result in a deal. It said it had abandoned plans to carve out Williams & Glyn as a separate bank.

RBS' return on equity was 11%, up from 10.9% the previous quarter but down from 13.5% a year earlier.  

RBS' common equity Tier One capital ratio slipped to 14.5% from 14.6% as at the end of the first quarter. RBS has a targeted floor level for that ratio of 13%.

Last week's stress tests by the European Banking Authority showed capital at the bank eroded at one of the fastest paces of the 51 institutions it tested in an adverse scenario. The common equity Tier One ratio hit a low point of 7.8% under the EBA's tests.

RBS' first-half loss was just under £2.05 billion. 

RBS shares fell 4.9% to 182.6 pence. Before today the stock had fallen 36% in the year and the government isn't seen likely to sell further shares in the bank this year after kicking off the gradual divestiture last year.