Morgan Stanley reported better-than-expected second-quarter results on Thursday as the U.S. investment bank outperformed rivals in tough trading conditions.

The bank reported a loss of 38 cents per share, much better than analysts' average forecast for a loss of 62 cents, according to Thomson Reuters I/B/E/S.

Morgan Stanley shares were up 7 percent in premarket trading.

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 bank earned $1.09 per share in the year-ago second quarter.

Net revenue climbed 17 percent from a year earlier to $9.28 billion and was 15 percent above the average estimate of $8.04 billion.

Results were boosted by a strong increase in equity sales and trading revenue, up by more than a third from a year ago. The bank said the gains reflected market share gains.

Stronger-than-expected results in the bank's fixed income, currencies and commodities (FICC) business, where revenue fell only slightly, to $2.1 billion from $2.3 billion a year ago, also helped.

In a statement, Morgan Stanley Chief Executive James Gorman said global markets remained challenging this quarter.

Weak trading conditions caused by economic uncertainty and tepid client activity have weighed on banks across Wall Street.

Tough markets combined with an overly risk-averse trading approach caused Morgan Stanley's chief rival, Goldman Sachs Group Inc, to badly miss expectations when it reported second-quarter results on Tuesday.

Gorman has been on an aggressive campaign to increase market share in FICC trading, trying to woo clients away from competitors and getting existing customers to trade more on Morgan Stanley's platform.

This is definitely a beat. Morgan Stanley managed to out-Goldman Goldman Sachs on the investment banking and the trading side, said Matt McCormick, portfolio manager at Bahl & Gaynor Investment Counsel.

(Reporting by Lauren Tara LaCapra, editing by Knut Engelmann and John Wallace)