Morgan Stanley surprised investors on Thursday with second-quarter financial results that showed long-awaited progress in its effort to seize market share from large investment banking rivals.

The U.S. investment bank's bottom line was helped by strong equity sales and trading results, surprisingly resilient fixed income trading, and lead underwriting positions on several big initial share offerings, particularly in technology.

We're seeing some progress here on the turnaround in Morgan Stanley's trading business, which has been a long time in the making, said Edward Jones analyst Shannon Stemm. That Morgan Stanley had such an increase here suggests that they were able to navigate and benefit from the volatility better than peers.

Morgan Stanley shares rose as much as 10.8 percent and were last up 10.2 percent at $23.94.

Even as investors celebrated, Morgan Stanley's top brass sounded a note of caution over the investment bank's wealth management business, whose profits still lag expectations.

Margins must improve and do so soon, a slightly impatient-sounding Chief Executive James Gorman told analysts in a conference call.

Gorman, a former McKinsey consultant who spent years running Merrill Lynch's retail brokerage, is struggling to rein in expenses in the wealth management business on which he is betting much of his reputation.

Morgan Stanley in June 2009 bought a majority interest in Citigroup's Smith Barney brokerage group. The combined wealth management business accounted for about 15 percent of the company's profit during the second quarter, but its profitability has sagged because of high expenses.

While Gorman expects the business to eventually deliver a pretax operating margin of 20 percent, the margin declined to 9 percent in the second quarter from 10 percent three months ago. The bank plans to cut costs and jobs to boost the margin.

Morgan Stanley's trading business was held back by a sharp drop in commodities-related revenue. But fluctuations in credit spreads helped the bottom line. As bond investors became more wary of financial-services firms during the quarter, the cost of insuring against their possible default rose, resulting in favorable accounting gains for the bank.

Overall, the bank reported a 10 percent drop in fixed income and commodities trading for the quarter, outperforming market expectations and bettering arch-rival Goldman Sachs.

However, when adjusting for Morgan Stanley's accounting gain and factoring in other trading business to make its results comparable to rivals, Barclays analyst Roger Freeman said Morgan Stanley's FICC results were actually down about 49 percent.

To be sure, FICC did have a challenging quarter, he said.

Goldman shocked investors only two days earlier by reporting a 53 percent plunge in its fixed income, currency and commodities (FICC) trading business. Weak market conditions and a pullback in its own risk-taking hurt Goldman's FICC results.

In contrast, Morgan Stanley increased its risk appetite during the quarter. Its so-called value at risk, a closely watched measure of potential trading losses, rose to an average of $145 million per day in the second quarter from $121 million in the previous quarter.

BROAD IMPROVEMENTS

Even with the wealth management and FICC difficulties, Morgan Stanley impressed Wall Street.

The bank reported a quarterly loss to common shareholders of $558 million, or 38 cents per share.

The loss included a charge of $1.02 per share and a dilution of the bank's share base from the conversion of a $7.8 billion preferred stock investment by Japan's Mitsubishi UFJ Financial Group. The conversion allows Morgan Stanley to avoid expensive dividends to the Japanese bank in the future.

The loss was much smaller than analysts expected. The average Wall Street forecast was a loss of 62 cents a share, according to Thomson Reuters I/B/E/S. In the same quarter a year ago, the bank earned $1.91 billion, or $1.09 a share.

Net revenue of $9.3 billion was up 17 percent from last year's quarter and also above what analysts anticipated.

It was the first time since the financial crisis that Morgan Stanley took in more revenue than Goldman Sachs.

Analysts were almost uniformly positive in their assessments.

Morgan Stanley is the new Goldman Sachs, said Rochdale Securities analyst Richard Bove. Every one of their divisions shows an improvement, and the improvement in trading operations is especially impressive.

Results were boosted by a strong increase in equity sales and trading revenue, up by more than a third from a year ago at $1.9 billion. The investment banking business also showed strength, with revenue up 66 percent at $1.5 billion.

In addition to advising on large mergers and improving equity underwriting results, Morgan Stanley reported its highest-ever net revenue in bond underwriting, a relatively small unit where revenues soared 59 percent to $521 million.

(Additional reporting by Svea Herbst and Jed Horowitz. Editing by Knut Engelmann, John Wallace and Robert MacMillan)