Third-quarter earnings surged 49% at Merrill Lynch ( MER), as the nation's largest brokerage saw big gains in revenue from trading and investment banking.

Merrill earned $1.38 billion, or $1.40 a share, in the quarter, up from $922 million, or 93 cents a share, in the year-ago period. The brokerage raked in $6.69 billion in net revenue, a 38% improvement over last year.

The New York-based firm easily surpassed Wall Street expectations. The Thomson Financial consensus estimate had Merrill Lynch earning $1.18 a share in the quarter and generating $6.14 billion in revenue.

The strong results from Merrill Lynch mirrored the heady profits posted last month by Goldman Sachs ( GS) and Lehman Brothers ( LEH), two investment banks whose third quarters ended in August.

The quarter was a good one across the board for Merrill Lynch.

Net revenue from investment banking rose 33% to $880 million, fueled in part by a healthy summer season for initial public offerings and a 55% gain in fees from bond underwriting. Commissions paid by customers increased 25% to $1.34 billion. Asset management fees grew 14% to $1.53 billion.

But the main reason for Merrill Lynch's blowout quarter was the stellar performance of its trading desk, particularly compared with last year. The third quarter of 2004 was dismal for Merrill Lynch's traders, with net revenues from proprietary trading of bonds, stocks and commodities falling 17%.

This year, however, it was a different story. Net revenues from principal transactions were up 128% to $810 million.

In the quarter, Merrill Lynch bought back 14.7 million shares.