Stocks posted their largest gains in nearly two weeks Tuesday as expectations the Federal Reserve may again try to spur economic growth trumped more weak data on manufacturing and housing.

The blue chip Dow Jones Industrial Average ended the day up 322 points, or nearly 3 percent, to close above the 11,000 level for the first time since last Wednesday. The Standard & Poor’s 500, a broader market measure, surged 3.4 percent. The Nasdaq, a more tech-heavy index, climbed 4.3 percent.

All three indexes are still down for August and for the year. Still, with the stock market trading near its lows for the year, many analysts expected a buying spree sooner or later.

“It was due for a bounce, whether it’s a dead cat bounce or a real bounce,” said Ron Kiddo, chief investment officer at Cozad Asset Management in Champaign, Ill.

The spark for Tuesday’s bounce, analysts said, was widespread expectation that Federal Reserve Chairman Ben S. Bernanke may use an upcoming speech Friday to press for more Fed action to stimulate the still-struggling economy.

“I can’t see the Fed sitting on their hands when you’ve got 9.2 percent unemployment,” said Scott Wren, senior equity strategist at Wells Fargo Advisors in St. Louis.

At a speech during the same time last year, Bernanke indicated the Fed would take up another round of bond-buying as a means to push money into the economy and lower interest rates. Markets are so eager for clues of similar action this year, Wren said, that “if you get bad economic news, the market might rally” on hopes the news will force Bernanke to act.

Indeed, markets brushed off a weak manufacturing activity report issued Tuesday by the Federal Reserve Bank of Richmond, the latest in a string of such reports. The Commerce Department also released a report showing that 298,000 new homes were sold in July, less than the 312,000 economists were expecting. But the news didn’t rattle markets, which surged even higher after a 5.8 magnitude earthquake hit the Washington metro area.

“They evacuated Capitol Hill, which is always good news on Wall Street,” joked Scott Brown, chief economist at investment bank Raymond James in St. Petersburg, Fla.

Scott added that investors should mind oil prices more than any hints of policy action by the Fed, since a drop would mean lower prices at the gas pump and more money for consumers and businesses.

But oil climbed higher as a resolution to the Libyan conflict seemed less clear Tuesday, putting in question resumed production from the oil-rich country. Brent crude, a major European oil benchmark, climbed 0.9 percent to $109.31.

As they flocked to stocks, investors fled some of the safe bets they’d been hoarding in recent weeks. Gold futures fell 1.6 percent to $1,858 per ounce, and the yield on the 10-year Treasury bond rose to 2.15 percent, up from 2.11 percent Monday.

A higher yield indicates investors are less willing to accept a smaller return in exchange for the safety of holding government debt.