Restructuring Swiss lender Credit Suisse (CS) - Get Report unexpectedly swung back into the black in the second quarter, reporting a net profit of Sfr170 million ($172.6 million).

The earnings compared with Reuters expectations for a loss Sfr192 million. Before tax Credit Suisse made a profit of Sfr199 million, compared with a Sfr484 million loss in the first quarter but well down from a Sfr1.66 billion profit a year ago.

Wealth management, a focus for the group since CEO Tidjane Thiam arrived a year ago, helped propel earnings. The division was particularly strong in Asia Pacific, a region which Thiam has said the bank will rebalance its business towards.

The company's global markets division, which Thiam has overhauled, cutting jobs and shuttering certain business lines, made a Sfr154 million profit, while investment banking and capital markets returned to the black, posting Sfr135 million of profit.

Net revenue for the quarter came in at Sfr5.4 billion, up from Sfr5.2 billion on the first quarter but down more than 16% year-on-year.

But Thiam sounded a note of caution, noting that markets were "particularly challenging towards the end" of the reporting period because of the U.K.'s Brexit vote.

"Our cost cutting program is progressing at pace, and we are working hard to build a more flexible, more resilient and more efficient bank that is fit for the new post-crisis regulatory and economic environment," he said. "We remain cautious in our outlook for the second half of 2016 in view of the uncertainty created by significant geopolitical and macro-economic concerns, reinforced a few weeks ago by the outcome of the UK referendum. In the coming quarters, we will continue to work steadily towards delivering our longer-term objectives and creating value for our clients and shareholders."

In the period Credit Suisse had a core equity Tier One capital ratio of 11.8% and said it wants to keep that ratio at between 11% and 12% this year.

Fears about a potential capital raise have weighted on the company's stock in recent months. In June the Swiss National Bank said Credit Suisse, as well as peer UBS, may need to raise an extra Sfr10 billion.

Credit Suisse shares closed up Sf0.07 at Sfr11.55 on Wednesday, giving the company a market value of about Sfr24.1 billion. They've fallen 55% in the past year.

The company said it cut $9 billion of risk-weighted assets in the second quarter from the previous quarter.