NEW YORK ( TheStreet) -- Stocks staged a mighty rally Tuesday, even shrugging off the uncertainty presented by a rare East Coast earthquake, as all three major U.S. equity indices gained at least 3%. Early buying was attributed to positive global economic data, which overshadowed another weak read on the U.S. housing market, as well as growing investor optimism about a high-profile speech due from Fed Chairman Ben Bernanke at the end of the week. The gains accelerated ahead of the close after the S&P 500 broke past 1150, a key technical threshold. Speculation that Bernanke will lay out a plan for the central bank to support the economy on Friday was a positive, along with promising news that the number of "problem" banks had shrunk for the first time since the financial crisis. Furthermore, no major negative headlines came out from the eurozone. When the closing bell sounded, the Dow Jones Industrial Average was up 322 points, almost 3%, at 11,171. The S&P 500 finished ahead 39 points, or 3.4%, at 1162, and the Nasdaq closed up 101 points, or 4.3%, at 2446. The 5.9 magnitude earthquake in Virginia put a slight dent in the Dow mid-afternoon, but the blue-chip index still finished just below its session high of 11,176. The sustained momentum was in stark contrast to Monday's action, which saw the Dow slowly surrender early gains throughout the afternoon. "Since last Thursday, the S&P 500 has tried to break above 1150. Crossing that today is giving people a better mood in terms of the technical," said Chris Johnson, chief investment strategist at Johnson Research Group. "There may not be a jump right up to 1200 but at least this is a relief rally." Johnson added that the situation in Libya has also given investors a reason to feel positive. "It's not a fundamental improvement but the market was tired of getting beat up," he explained. The chatter about Bernanke's speech at the Kansas City Fed's annual economic conference in Jackson Hole, Wy., on Friday will provide a backdrop for stock action the rest of the week. Although most market watchers don't expect Bernanke to signal another quantitative easing program as he did at the symposium last year, many believe he will at least shed further light on the Fed's stance on how it could help given the inflationary pressures in the current economy. The Federal Deposit Insurance Corp. took 23 institutions off their "problem list," marking the first decline in that list of more than 800 banks since 2006. While this news suggested that fewer institutions are at risk of failing, fears about mortgage-related assets and falling revenues continue to plague the financial sector. Encouraging economic data out of China gave a lift to global markets earlier. A purchasing managers index showed that manufacturing activity in China contracted at a slower pace in August than economists expected. Meanwhile, manufacturing activity in Germany also came in better-than-expected . A purchasing managers index for the eurozone, however, remained near a two-year low for August, confirming stagnated growth in the region. The FTSE in London added 0.7% and the DAX in Frankfurt gained 1.1%. Hong Kong's Hang Seng jumped 2% and Japan's Nikkei advanced 1.2%.
Technology and energy stocks led the rally with Exxon Mobil ( XOM), Chevron ( CVX), IBM ( IBM) and Microsoft ( MSFT) trading near the top of the Dow. Of the 4 billion shares trading on the New York Stock Exchange, 80% rose while 20% fell. Some 1.7 billion stocks changed hands on the Nasdaq. The mildest gains were seen across the utilities and basic materials sectors. Amid broad gains, Bank of America ( BAC), Walt Disney ( DIS), and Travelers ( TRV) were the only Dow components that closed in the red.