UBS flagged a return to client inflows this year as strong equities and forex trading gains helped it outdo Deutsche Bank and other rivals, which were hit hard by Europe's sovereign debt crisis.

UBS's strong second quarter investment banking results stood out against a weak performance at U.S. banking giants Goldman Sachs and Citigroup Inc , lifting shares 10 percent as investors believed Chief Executive Oswald Gruebel's tough restructuring strategy was producing results.

With a Tier 1 capital ratio of 16.4 percent, investors also saw UBS as a key winner from a decision by central bankers and regulators on Monday to soften planned new bank rules, known as Basel III.

UBS, which was hit by the credit crisis and a tax probe, was able to slow a bleeding of client money to its lowest level since it started to lose assets in early 2008.

We have fared well through the euro crisis thanks to our good risk management approach, said Gruebel, a former Credit Suisse CEO who was pulled out of retirement in 2009 to lead UBS.

I am confident we can stop the client outflows this year, the former bond trader said.

Net profit was 2 billion Swiss francs ($1.9 billion), UBS' third quarterly profit in a row after big losses in 2008 and 2009, and above forecasts of 1.34 billion francs.

The UBS franchise is solid. I believe their numbers will improve further into the year, said Marc Gabelli, president of the Gabelli Group, parent of $29 billion U.S. asset manager GAMCO .

The bleed is over and now they will begin to regain share.

Swiss competitor Credit Suisse also beat forecasts with a second-quarter profit of 1.6 billion, but tax and accounting gains had partly offset a significant quarterly decline in investment banking.

DEUTSCHE SOVEREIGN EXPOSURE DOUBLES

Deutsche, which fared better than UBS in the credit crisis, turned in a net profit of 1.2 billion euros, only slightly above a poll consensus of 1.04 billion euros, as weaker trading income was offset by pretax profit outside the investment bank and gains from the integration of assets bought from ABN Amro.

Deutsche also revealed its exposure to sovereign debt risk in southern Europe was double its initial estimate, contrasting with UBS' net immaterial sovereign exposure.

We went into the quarter relatively well risk-managed, UBS Chief Financial Officer John Cryan told an analyst conference. We were not convinced the markets would remain as positive. That was essentially the differentiating factor (vs rivals).

Shares in Deutsche Bank, Germany's largest bank and Europe's No.13 by market value, were up 6.4 percent at 1308 GMT against a 4.8 percent rise in the European Stoxx 600 banking index<.SX7P>.

European credit derivative indexes hit their tightest levels in two months, supported by reassuring results from UBS and DB, data from the investment-grade Markit iTraxx Europe index showed

IS GRUEBEL'S MAGIC WORKING?

UBS said clients drained a total of about 5 billion francs at the Swiss bank's wealth and asset management units, sharply down from outflows of 18 billion francs in the first quarter.

On a net basis, UBS was able to win 2.6 billion francs of client money at its global asset management, the first time the division saw net inflows since the start of 2008.

But these were offset by outflows of 5.5 billion Swiss franc at UBS' Wealth Management & Swiss Bank division and withdrawals of 2.6 billion in Wealth Management Americas.

The U.S. wealth unit was unprofitable due to a restructuring charge, but Cryan said inflows here should materialize soon.

We have seen a turnaround in investment banking that was not expected so early. These are good numbers in terms of outflows, which have stabilized, said Francois Savary, chief investment officer for the private banking unit of Reyl. Gruebel was hired to produce a turnaround at UBS and he is delivering.

On Tuesday Swiss wealth manager Union Bancaire Privee, hit by the credit crisis and the Madoff affair, reported net client inflows for the first time in two years.

Deutsche's corporate banking and securities division, run by 47-year old Anshu Jain, posted 779 million euros in pretax profit. This, together with 478 million euros contribution from transaction banking accounted for the lion's share of 1.52 billion euros ($1.96 billion) in group pretax earnings.

Jain is a favorite to succeed Chief Executive Josef Ackermann when he retires in April 2013.

Sharply lower loan loss provisions also helped Deutsche, which stuck to its 2011 target of 10 billion euros from its core businesses, although struck a more cautious tone.

In contrast, Spanish bank Popular missed first-half forecasts as its core banking business softened and bad loans rose.

(Writing by Lisa Jucca and Edward Taylor, Additional reporting by Katie Reid and Martin de Sa'Pinto in Zurich; Editing by Louise Heavens)