Morgan Stanley posted a fourth-quarter profit of $413 million on Wednesday, helped by an upswing in its investment banking business.

The New York-based bank reported a quarterly net income of 29 cents a share for shareholders, compared with a loss of $10.5 billion or $11.35 a share in the year-earlier quarter.

It set aside $3.8 billion for compensation expenses in the fourth quarter.

Shares in Morgan Stanley closed up 78 cents or 2.6 percent, at $31.16 on Tuesday. Shares were up about 1 percent in trading before the New York Stock Exchange's opening.

(Reporting by Steve Eder, editing by Gerald E. McCormick)