NEW YORK — John Mack might have just handed Wall Street the turnaround he pledged after becoming chief executive of Morgan Stanley in 2005.

After languishing just a few years ago, the nation's No. 2 investment bank has wrangled its way back as one of Wall Street's shrewdest players. It said Wednesday its second-quarter earnings rose 39 percent, powered by record performances across most of its businesses.

But beating last year's numbers handily isn't the only thing that counts in the competitively charged investment banking industry. The true measure is how profit growth outpaced rivals — and the first half of 2007 has put Morgan Stanley in the pole position.

"I think you can say 'mission accomplished,"' said Richard Bove, an analyst with Punk Ziegel & Co. "You have to put capital at risk in a meaningful fashion, and that's just what he did."

Morgan Stanley's profit in the first half grew three times faster than at Goldman Sachs Group Inc., the biggest U.S. investment bank. Profit during the second quarter was stronger than at Goldman, Lehman Brothers Holdings Inc. and Bear Stearns Cos., which all reported results last week.

For the three months ended May 31, profit after paying preferred dividends rose to $2.57 billion, or $2.45 per share, from $1.84 billion, or $1.75 per share, a year earlier.

The record run on stocks this year — and the frenzied pace of corporate takeovers — helped lift revenue 32 percent to a record $11.5 billion. Results topped Wall Street projections for a profit of $2.01 per share on $10.03 billion of revenue, according to analysts polled by Thomson Financial.

"We've been very clear about what it is we needed to do to turn the company around, and we've been showing progress along the way," said David Sidwell, Morgan Stanley's chief financial officer. "John has kept us very focused on building the company, and diversifying. That's why you are seeing, year-on-year, very good results."

Mack, who led Morgan Stanley into its now ill-fated combination with Dean Witter, left the company in 2001 after a falling out with then-CEO Philip Purcell. A coup among some of Morgan Stanley's top executives, board members and shareholders ushered Mack back into the job four years later.

His mandate was simple: boost the company's sagging share price and make it competitive again.

It appears to be working. In the two years since Mack took over, Morgan Stanley's share price gained 67 percent. Shares fell 48 cents to $87.32 Wednesday.

Morgan Stanley said revenue from its equities sales and trading rose 33 percent to $2.2 billion during the quarter, reflecting another strong showing from its prime brokerage. Meanwhile, its fixed-income division — which handles trading in bonds and mortgages — rose 34 percent to $2.9 billion.

Continued strength in corporate takeovers drove investment banking revenue to a record $1.7 billion, up 65 percent year-over-year. Morgan Stanley has advised on a number of high-profile deals during the second quarter.

Asset management, an area that Mack identified as a pivotal business as part of the company's turnaround, also performed well. Assets under management reached $560 billion, a 23 percent rise from a year earlier.

"I think he's made great progress in getting the franchise to earn up to its potential," said Jeffery Harte, an analyst with Sandler O'Neill & Partners. "Getting caught up is one thing, but capitalizing on the growth that's out there is quite another."