Credit Suisse's first-quarter net profit far exceeded forecasts thanks to surprisingly robust trading gains and healthy rich client inflows, making it upbeat about its future while other banks still struggle.

Credit Suisse on Thursday posted a net profit of 2 billion Swiss francs ($1.71 billion) after its investment bank recorded trading revenues of 4.9 billion Swiss francs, triggering a 5-percent share rally.

News that Switzerland's second-largest bank had swung back to profit after a record annual loss in 2008 adds to optimism about the banking sector sparked by forecast-beating results from Goldman Sachs and JP Morgan Chase and contrasts with the problems still faced by Swiss rival UBS .

Credit Suisse was right not to disinvest in fixed income and equities trading as it recovered, said Alain Tchibozo, a Paris-based bank analyst with ING Wholesale Banking.

UBS and all those banks that have completely closed down certain segments could not benefit from this.

Shares in Credit Suisse were up 6.8 percent at 42.30 francs at 0703 GMT, outperforming the Dow Jones index of European banks <.SX7P>, which was down 0.91 percent.

We remain optimistic about the prospects for Credit Suisse, particularly in the context of the overall industry, Chief Executive Brady Dougan said in a statement.

The bank continued to cut risky positions and was able to boost its capital base to a tier 1 ratio of 14.1 percent of risk-weighted assets, making it one of Europe's best capitalized banks with capital well above strict Swiss requirements.

Asset management remained unprofitable.

Analysts polled by Reuters had expected Credit Suisse to post a net profit of 948 million Swiss francs. Credit Suisse's bottom line beat the highest forecasts thanks to hefty trading profits and gains it made on its own debt.

ONE SHINES, THE OTHER STRUGGLES

Credit Suisse's net profit shone compared with a forecast of a 2 billion franc loss in the first quarter by larger Swiss competitor UBS , which has been hit harder in the crisis and is still struggling to recover.

The results were very good, especially the development in investment banking, that reminds us of the good old days, said a Swiss trader. The crisis begun 18 months ago and some banks like Credit Suisse have had the time to put their business back in shape.

Credit Suisse reported 1.4 billion francs of writedowns as it cut its most illiquid assets by a further 31 percent and said its private banking division had net new inflows of 11.4 billion francs, an indication the bank is still attracting wealthy clients despite global pressure on Swiss bank secrecy.

During the quarter we saw our client businesses generate strong revenue growth and gain market share, Dougan added.

The bank said its investment banking business had benefited from generally improved market conditions, lower costs as well as fair value gains of 365 million francs on its own debt.

Credit Suisse, which reports under U.S. Generally Accepted Accounting Principles (GAAP), said it had not taken advantage of a new U.S. accounting rule that allows banks to mark to model certain illiquid assets.

It said it would use it from the second quarter but does not expect a significant impact on fair value from the rule.

Unlike UBS, Credit Suisse has managed to survive the crisis without state aid and was able to raise 10 billion Swiss francs from investors at the end of 2008 to boost its capital base.

Credit Suisse posted its biggest ever loss, 8.2 billion francs, in 2008.

It serves about 700,000 wealthy individuals globally, managing assets worth 646 billion francs at the end of 2008. It gathered 42.2 billion francs of new wealth management assets last year.

Credit Suisse said it had cut 120 relationship managers but added it was still hiring selectively in key areas. The bank has placed ads to hire staff in Asia, while rivals have been cutting down. UBS said last week it was cutting another 8,700 jobs globally.

($1=1.170 Swiss francs)

(Editing by Greg Mahlich; Editing by Jon Loades-Carter)