Morgan Stanley on Thursday beat analysts' estimates for second-quarter profit as a buoyant stock market helped two of the investment bank's three main businesses.

The bank posted earnings of $2.2 billion, or $1.23 a share, exceeding the $1.14 estimate of analysts surveyed by Refinitiv. Revenue of $10.24 billion exceeded the consensus estimate by almost $250 million on better-than-expected results in the firm's wealth management and investment management divisions.

Shares of the bank rose 0.7% at the open of trading after earlier declines in premarket activity.

Morgan Stanley's wealth management division, one of the biggest in the world, posted a record $4.41 billion in revenue, exceeding analyst's estimate by $60 million. Its investment management division, an asset manager that creates mutual funds, posted $839 million in revenue, exceeding estimates by about $130 million. The business benefited from "higher assets under management" across asset classes, according to the firm.

Rising markets helped in "both the wealth business, in terms of the assets we manage, as well as our investment management business," Chief Financial Officer Jonathan Pruzan said in a phone interview. "It's fee times the balances — if the markets go down, you'd expect to see pressure in that area."

Under CEO James Gorman, Morgan Stanley has emphasized its wealth management division, a far steadier business than its trading operations. The brokerage benefits from rising markets as fees typically climb along with assets under management.

Results were more mixed in the firm's biggest business, institutional securities, which houses its Wall Street investment banking and trading operations. Equities trading produced $2.13 billion in revenue, under the $2.2 billion estimate of analysts surveyed by FactSet. Fixed income trading made $1.13 billion in revenue, missing the $1.32 billion estimate. Investment banking generated $1.47 billion in revenue, edging out the $1.4 billion estimate.

"We view Morgan Stanley's 2Q19 results as solid against a choppy operating backdrop, but also generally straightforward without any big surprise," Devin Ryan, an analyst at JMP Securities, said in a research note. "We believe the market's bigger focus today will be on management's outlook commentary heading into the second half of 2019."

As with the other banks, analysts peppered management with questions about how falling interest rates will impact results.

The bank saw net interest income fall to $1 billion in the quarter and said it could be impacted later this year if the market's assumptions on rate cuts are realized, Pruzan said. A rate cut could assist trading desks if it produced the right type of volatility, he added.

Net interest income "is important to us, but not as important as it is to some of the other banks," Gorman said Thursday on the analyst conference call. "It's clearly a headwind, but its not like we don't have some other things going on under the hood here."

Shares of the firm have climbed 10% this year before the earnings report, trailing the KBW Bank Index and competitors including Goldman Sachs and J.P. Morgan Chase.

The firm said last month it won permission from the Federal Reserve to increase its quarterly dividend to 35 cents a share from 30 cents and repurchase $6 billion in shares.

Morgan Stanley is the last of the six largest U.S. banks to report second-quarter earnings. Citigroup, J.P. Morgan, Wells Fargo, Goldman Sachs and Bank of America all beat analysts' profit expectations as most of the firms benefited from one-time items including a gain on the IPO of electronic trading platform Tradeweb.

Here's what Wall Street expected:

Earnings: $1.14 a share, 12% lower than a year earlier, according to Refinitiv

Revenue: $9.99 billion, 5.8% lower than a year earlier

Wealth management: $4.35 billion, according to FactSet

Trading: Equities $2.2 billion, fixed Income $1.32 billion

With reporting from CNBC's Leslie Picker.