The central bank made a profit of 34.4 billion francs from its foreign currency positions, which included dividends and valuation gains on stocks as well as interest payments and a higher value of its bond holdings.

The SNB had a 38.2 billion franc first-quarter loss.

"The first half of 2020 was dominated by the effects of the coronavirus pandemic, which led to high volatility on the financial markets," the central bank said in a statement.

"Strong fluctuations are therefore to be expected, and only provisional conclusions are possible as regards the annual result," it said.

The central bank made a valuation gain of 4.3 billion francs from its gold holdings during the second quarter, while it also made a small profit from its Swiss franc positions, mainly the negative interest rates it charges commercial banks.

Although making a profit is not part of the SNB's mandate, Switzerland's federal and regional governments appreciate the payout it makes, which increased to 4 billion francs this year.

"The size of the SNB's balance sheet makes the SNB's profit vulnerable to large fluctuations in the value of the franc," said UBS economist Alessandro Bee.

"The SNB has a portfolio of roughly 300 billion francs in euro-denominated assets, and if the franc appreciates by just 1% that can reduce its value by 3 billion francs."

Higher profits increase pressure on the SNB to make a special payment to the Swiss government to help tackle the COVID-19 impact on the economy.

"The pressure is certainly increasing and the SNB has already paid more to the Swiss government and cantons this year than it normally does," said Bee.

"But I think this is a pressure the SNB will want to resist because it could open the door for even more demands ranging from financing social security to environmental sustainability."

By John Revill