Updated from 9:16 a.m. EDT

Goldman Sachs

(GS) - Get Report

, in what has become a familiar pattern during the bull market, reported another blowout second quarter Tuesday, saying earnings more than doubled, while revenue far exceeded expectations.

But with Wall Street spooked of late by signs of inflation and a slowing economy, the quarter wasn't good enough to stop investors from selling. In midday trading, shares of Goldman Sachs were down $4.68, or 3.2%, to $140.32.

Including gains from the sale of a power plant and part of its stake in the

New York Stock Exchange

, Goldman Sachs earned $2.31 billion, or $4.78 a share, in the quarter, up from $865 million, or $1.71 a share, a year ago. Revenue more than doubled to $10.1 billion, from $4.81 billion.

Excluding expenses related to the accounting treatment for stock options, Goldman Sachs said it earned $2.40 billion, or $4.97 a share. Whether analysts excluded the options expense or not, Goldman's results were well ahead of forecasts, which called for earnings of $4.28 a share on revenue of $8.26 billion.

The impressive quarter almost matched the firm's record-shattering first quarter, in which it earned $2.48 billion, or $5.08 a share, on revenue of $10.3 billion.

In the second quarter, Goldman Sachs reported strong revenue from investment banking, trading and principal investments. Investment-banking revenue rose 87% to $1.53 billion. Revenue from trading and principal investment more than doubled to $6.96 billion compared with the year-ago period. Asset-management revenue rose 37% to $1.61 billion.

On a sequential basis, the second quarter was little changed from the first. Revenue from investments rose 4% from the first quarter of this year. Revenue from trading and principal investments was basically flat, up 1%.

Goldman's main profit center continued to be its fixed-income, currency and commodities desk, where revenue rose 15% from the first quarter to $4.3 billion. Within that number, however, was a gain of $700 million from the sale of a power plant. The sale could have masked weakness in commodities trading, which experienced tremendous volatility in the quarter.

Stock trading showed some weakness, falling 12% from the first quarter of this year to $2.35 billion.

Brad Hintz, a Sanford Bernstein analyst, says the quarter included about 69 cents of earnings attributable to one-time events, such as the sale of the power plant. Hintz noted that once again, much of Goldman Sachs' earnings were fueled by trading. He says the firm is cashing in on the volatility in financial markets, but it's questionable how sustainable the momentum will prove to be.

In a conference call with analysts, Goldman Sachs CFO David Viniar said the current weakness in the stock market has not had a significant impact on the firm's business. But that could change, if the selloff, which began in May, continues for another few months.

"The credit markets have remained pretty strong and, to date, there hasn't been a decline in corporate activity level,'' says Viniar, who notes that no IPOs have been cancelled since the downturn began." If market weakness continues for another four or eight weeks, that could change."

Goldman Sachs' earnings report, as good as it is, was competing for investors' attention Tuesday with the producer price index, which rose 0.2% in May, according to the Labor Department. For nearly two months, stocks have been whipsawed by investor concern over rising inflation, an event that's never good for stock prices or Wall Street investment firms.

Indeed, brokerage stocks have been hit particularly hard during the market selloff. Though the Amex Broker Dealer index is up about 3% for the year -- outpacing the broader averages -- the index had been up 23% as recently as mid-April.

The wave of selling on Wall Street is being precipitated by concern that the

Federal Reserve

will move to keep a lid on inflation by continuing to ratchet up interest rates. Earlier this year, stocks rallied on the belief that the Fed was ready to put the kibosh on further interest rate increases.

Many on Wall Street believe brokerage stocks will being climbing again once investors get a clear signal that the Fed is done raising rates. The bulls note that the pipeline for stock and bond offerings remains strong, and companies are still considering mergers. But the cynics say the fast-money crowd will look elsewhere for fat returns, as evidence mounts that the economy is cooling and consumer confidence is faltering in the face of high gas prices.

Goldman Sachs is the second of the big Wall Street firm to report earnings this week.

On Monday,

Lehman Brothers

(LEH)

reported its second-best quarter ever, saying profits rose 47% in the period. But investors looked past that big number and focused instead on the prospect that Wall Street's best days may be over. Shares of Lehman fell more than 5% yesterday, dragging down other brokerage stocks with it.

Bear Stearns

(BSC)

reports earnings on Thursday.

Morgan Stanley

(MS) - Get Report

reports next week.

The trading gains at Goldman Sachs, which include trading for the firm's own account as well as making markets for its customers, came from stocks, bonds and commodities.

To score those gains, Goldman Sachs stuck its neck out. The closely watched "value at risk" metric, which gauges how much money a firm could lose in a single day if all its trades went bad, was $112 million in the quarter, up from $60 million a year ago and $92 million in the first quarter of 2006.

One thing skeptics have warned about in recent years is that big Wall Street firms are putting too much of their own capital at risk to generate outsized trading profits. So far, Wall Street firms such as Goldman Sachs have shown that those risks are worth taking, as they've generally posted strong trading gains for two straight years.

Viniar says Goldman Sachs is prudent with the amount of risk it takes. He says the firm only raised its risk level when it sees trading opportunities in the market. Conversely, the firm reduces its exposure to trading losses when it sees less opportunity to make money.

"I'm not going to tell you what our risk levels are now,'' says Viniar. "But when we see opportunities diminish, we take our risk down.''

Even with the recent selling pressure, shares of Goldman Sachs are up 11% for the year. And over the past 52-weeks, shares of the stories investment firm have outperformed all of its peers.