Morgan Stanley reported a third-quarter profit, reversing a year-earlier loss, helped by a large accounting gain that stemmed from declines in the value of its debt.

The second-largest U.S. investment bank earned $2.15 billion, or $1.15 per share, compared with a loss of 7 cents per share a year earlier. Revenue climbed 46 percent to $9.89 billion.

Excluding a gain of $3.4 billion from debt valuation adjustment, Morgan Stanley earned 2 cents per share. When a bank's debt weakens relative to U.S. Treasuries, it can record an accounting gain because it could profit from buying back the debt.

Morgan Stanley shares were up 18 cents at $16.81 in premarket trading.

Revenue from its trading business more than doubled from a year earlier and climbed 24 percent from the second quarter. The sharp increases reflect the DVA gain.

Its wealth management group reported $3.26 billion in revenue, up 5 percent from a year ago but down from the second quarter.

Asset management revenue of $215 million fell 73 percent from the year-ago period and 67 percent from the second quarter due to losses on principal investments in its merchant banking and real estate investing business.

(Reporting by Lauren Tara LaCapra in New York; editing by John Wallace)