Morgan Stanley on Wednesday said its second-quarter profit rose 40 percent, trouncing expectations as most of its trading and investment-banking businesses achieved record results.

The blowout results come a week after Lehman Brothers' strong earnings fueled optimism that Wall Street would escape any harm from rising subprime mortgage losses. But expectations were dampened after Goldman Sachs' and Bear Stearns' fixed-income trading profits took hits.

That set the stage for Morgan Stanley, which posted the highest increase in earnings for the period and used the word record more than 30 times in its news release.

The tone was starting to get pessimistic. Now it really looks like institutional securities, investment banking, everything was pretty strong across the board, said Benjamin Wallace, an analyst at Grimes & Co., a Westborough, Ma., money manager that owns Morgan Stanley shares.

The No. 2 investment bank by market value said net income rose to $2.58 billion, or $2.45 a share, in the quarter ended May 31, from $1.84 billion, or $1.75, a year earlier. That beat the average profit forecast of $2.00, according to Reuters Estimates.

Net revenue rose 32 percent from last year to a record $11.5 billion, also exceeding forecasts.

Excluding items, analysts expected Morgan to earn $2.01 a share.

This is was another great quarter for Morgan Stanley, Fox-Pitt Kelton analyst David Trone said in a research note. We view Morgan Stanley as the clear top performer in the group over the first-half period.

The news sent Morgan Stanley shares climbing, up $1.60, or 1.8 percent, to $89.40 in early New York Stock Exchange trade after hitting a session high of $90.33.

TRADING GAINS

Net revenue from the trading and investment banking division rose 39 percent to a record $7.4 billion, powered by record M&A and underwriting fees.

That included fixed-income sales and trading revenue of $2.9 billion, up 34 percent. It was Morgan Stanley's second-best fixed-income quarter ever, fueled by strong interest rate, currency and commodities results that were offset a bit by a decline in energy commodities.

Chief Financial Officer David Sidwell in an interview said Morgan Stanley's mortgage revenue slipped from the first quarter when it profited from hedge positions, though other trading businesses helped offset any weakness.

In the second quarter, there were less opportunities to manage those positions because the spreads in the market remained more stable, Sidwell said.

He cautioned that wider spreads and a lack of liquidity going forward could further push down mortgage securities and structured-debt investments.

In the near term, this is an area firms have to stay focused on, said Sidwell, whose comments come as Bear Stearns scrambles to save two hedge funds that suffered steep losses on mortgage investments.

The outlook for investment banking is bright, as the pipeline of pending M&A and underwriting deals expanded from the first quarter. Through the end of May, Morgan was No. 1 in completed M&A worldwide and second in announced M&A.

Equities trading rose to an all-time high, fueled by hedge-fund services and derivatives, in line with the strong growth reported by other large securities firms this month.

Now nearly two years on the job, Chief Executive John Mack has been working to revive brokerage, money management and credit-card businesses that had dragged on overall growth. Those efforts continue to show progress.

Quarterly wealth management revenue rose 17 percent to $1.64 billion, as client assets grew 16 percent to $728 billion. In asset management, where Morgan expanded its hedge fund offerings and launched a private equity business, revenue surged 68 percent to $1.51 billion.

The Discover credit card and payments division reported a 13 percent decline in revenue and a 38 percent drop in pretax income from last year, when loan losses remained unusually low following changes to U.S. bankruptcy laws. Morgan plans to spin off Discover to shareholders next week.