The Swiss National Bank booked a profit for the first nine months of the year, helped by a rise in the value of its gold holdings, a relief after periods of big losses from currency interventions last year for which it drew sharp criticism.

The SNB said on Monday it had swung to an overall nine-month consolidated profit of 5.8 billion Swiss francs (4.1 billion pounds) from a loss of 10.8 billion in the first half.

The net gain from foreign currency positions was some 0.3 billion francs for the first nine months of the year. Income from dividends and interest offset exchange-rate-related valuation losses of 4.7 billion francs, down from the 11.7 billion franc loss it reported for the first half of 2011.

A valuation gain of 5.0 billion francs was achieved on the bank's unchanged amount of gold holdings, the SNB said and its fund of toxic assets from UBS reported a profit of $1.306 billion.

After the safe-haven franc shot up to near parity with the euro on fears about sovereign debts in the euro zone, the SNB set a cap of 1.20 francs per euro on September 6, saying it was ready to buy foreign currency in unlimited quantities.

A SNB spokesman also said the bank recorded a profit on its foreign exchange holdings in the third quarter as the Swiss franc fell against the dollar and the yen.

The SNB had already said its forex reserves rose by 29 billion Swiss francs in September, its first month of capping the franc, due to higher money market operations rather than interventions to defend the franc.

The nine-month results yielded no further clues on the SNB's activities to maintain the cap, which analysts estimate it has managed to do at minimal expense.

So far the SNB's ceiling of 1.20 has held and the franc has even weakened further, and the central bank's policy has been supported by industry and politicians of various parties.

That stands in contrast to 2010, when the SNB was sharply criticised for having run up a loss of 19 billion francs -- its biggest ever -- due to interventions to weaken the franc.

It's fundamentally positive, Credit Suisse economist Fabian Heller said of the results. (But) the SNB has said that its ability to act remains regardless of whether they post a profit or loss.

The support for the SNB has been much stronger in past weeks and months, compared to what it was a year ago, he also said.

The right-wing Swiss People's Party (SVP), the country's biggest political force, fiercely criticised the SNB for its loss last year but it changed course in August as the franc squeezed exporters to support the cap.

Switzerland's 26 cantons (states) are the SNB's biggest shareholders, and the SNB has warned repeatedly that they may not receive their regular dividend this year. The SNB said on Monday its priority was to rebuild its reserves.

At present, no statement can yet be made on whether any dividend payment to shareholders, or any distribution to the confederation and cantons will be made for 2011, it said.

The SNB set up the fund as part of the bailout of the country's largest bank in 2008, which suffered huge losses after risky bets turned sour.

(Reporting by Silke Koltrowitz and Catherine Bosley; editing by Anna Willard)