Royal Bank of Scotland Group Plc unexpectedly posted a second-quarter profit as the British government prepares to reduce its stake in the lender, even as it set aside more money for litigation and restructuring.

Net income was 293 million pounds ($457 million), up from 230 million pounds in the year-earlier period, Edinburgh-based RBS said in a statement on Thursday. Analysts had expected a loss of 259 million pounds in the period, according to the average estimate of 10 in a company survey.

Chief Executive Officer Ross McEwan is selling assets and cutting thousands of jobs to return the bank to annual profit ahead of the U.K. government’s plans to sell 25 billion pounds of its RBS shares within five years. The bank took a 1.1 billion-pound restructuring charge in the second quarter and 459 million pounds for conduct and litigation.

The results follow a 446 million-pound loss for the first quarter when the bank set aside money for currency-manipulation probes. Chancellor of the Exchequer George Osborne has said he plans to start reducing the U.K.’s 78 percent stake in RBS within months, even though it may cause a loss for taxpayers, who provided RBS with 45.5 billion pounds of capital during the financial crisis.

Profit excluding restructuring costs and conduct and litigation charges was 1.8 billion pounds, down from 1.9 billion pounds a year earlier. That beat the 1.3 billion-pound estimate of four analysts in a Bloomberg survey.

The bank’s common equity Tier 1 ratio, a measure of financial strength, was at 12.3 percent at the end of the first half, up from 11.5 percent at the end of March.

The stock has slumped about 10 percent this year, the worst performing major U.K. lender. Lloyds Banking Group Plc has gained 13 percent as the government reduced its stake to less than 15 percent.

Source: Bloomberg