UBS said Thursday morning a trader has lost about $2 billion in unauthorized dealing and warned it might post a loss in the third quarter, a huge blow as the Swiss bank struggles to rebuild its credibility after years of crises.

UBS said the person behind the unauthorized trades had been detained in London, where police said they had arrested a 31-year-old man on suspicion of fraud. Swiss newspaper NZZ cited UBS as saying the trader worked in its London equities division.

The loss threatens the future of UBS's investment bank, which is being reviewed by Chief Executive Oswald Gruebel as part of a wide-ranging restructuring following heavy losses in the credit crisis and a damaging scandal over bankers helping rich U.S. clients dodge taxes.

UBS said it was possible that the trading loss could cause an overall loss in the third quarter of this year. It also said that no client positions were affected.

"The matter is still being investigated, but UBS's current estimate of the loss on the trades is in the range of $2 billion," the bank said in a brief statement.

In an internal email the bank said the unauthorized trade was "distressing" and it would "spare no effort" to find out what happened.

UBS employed almost 18,000 people in its investment bank at the end of June, most of them based outside Switzerland, particularly in London and the United States.

A spokesman declined to give any further details.

UBS shares were 5.5 percent lower at 10.33 Swiss francs at 0837 GMT, far weaker than the European banking sector, which was up 1.3 percent.

"(This) is a staggering demonstration that all the clever systems that the banks now have, especially after the financial crisis, still cannot stop a determined individual getting round them if they want to," said Chris Roebuck, visiting professor at Cass Business School in London.

"It will yet again confirm to the majority of shareholders who are Swiss that investment banking is not 'proper' banking, as private banking is."

Any losses in its investment bank risk scaring UBS's rich clients and prompting a further flight from its huge private bank, the core of its business.

"This loss has the scope to have a material impact on the perception of UBS' private bank, impacting its future operating trends," Goldman Sachs analysts Jernei Omahen and Peter Skoog wrote in a note.

"Today's announcement therefore adds to the long list of arguments (and pressure) for a substantially smaller investment bank."

UBS's news caused disbelief among market operators, coming so soon after former Societe Generale trader Jerome Kerviel racked up a $6.7 billion loss in unauthorized deals revealed in 2008. Kerviel was sentenced to three years in prison in October 2010.

"It is amazing that this is still possible," said ZKB trading analyst Claude Zehnder. "They obviously have a problem with risk management. Even when the amount isn't so high, it is once more a loss of confidence that casts UBS in a poor light."

"With this they are losing a lot of credit that they had regained with effort," he added.

Switzerland's financial markets regulator FINMA said it had been informed of the rogue trader case and was in close contact with UBS.

The bank has in the past two years tried to rebuild the investment bank that nearly felled it during the financial crisis. It needed a state bailout after heavy losses on U.S. subprime mortgage-related securities.

Under Gruebel and investment bank boss Carsten Kengeter -- themselves both once traders -- it has hired hundreds of traders, in a bid to boost its bond business.

Former Bundesbank head Axel Weber is due to join the UBS board next May and take over as chairman in 2013.

The weak performance of the investment bank and tough capital rules in Switzerland had already attracted intense scrutiny over how UBS will cope, with analysts calling for a retrenchment of the investment bank.

UBS had started to see client confidence return this year after it had to be rescued by the Swiss state in 2008 following massive losses on toxic assets held by its investment bank.

UBS said last month it was to axe 3,500 jobs to shave 2 billion Swiss francs ($2.3 billion) off annual costs as it joins rivals in reversing a post-crisis hiring binge and preparing for a tough few years.

(Additional reporting by Andrew Thompson in Zurich and Sarah White and Douwe Miedema in London; Writing by Sophie Walker; Editing by Will Waterman)