"This is very encouraging," said Ken Tower, chief market strategist at Covered Bridge Tactical. "Today is a test of investor confidence about the ability of earnings to come in at or even better than expectations."
A slump in the dollar, which hit another record low against the euro following high inflation numbers in Europe, also provided a lift to commodities and their related stocks. The materials sector surged 4%, leading the gains on the broader S&P 500 index, closely followed by the information technology and industrials sectors.
Crude-oil prices topped $115 a barrel for the first time, which failed to dent the market's advance, while giving a further boost to energy shares.
The Dow Jones Industrial Average finished up 256 points to 12,619, with 28 of its 30 components advancing.
Shares of Intel climbed 5.8% as the chipmaker predicted a 56% gross margin for the second quarter and said revenue would be better than analysts expected.
"On Friday, we had the bad surprise from GE," Tower said. "But this week, we're seeing investors pleasantly surprised that earnings overall are not as bad, supporting the view of a shallow economic decline instead of a more severe one."
Fueling gains for financial stocks on the Dow and the broader market, J.P. Morgan Chase's first-quarter profit, while cut in half, wasn't as bad as analysts predicted.
J.P. Morgan shares rose 6.7%, while Citigroup Inc. gained 2.8%, Bank of America gained 3.9% and AIG rose 3%.
The S&P 500 index advanced 30 points to 1,364 and the tech-heavy Nasdaq Composite rose 64 points to 2,350.
Trading volumes showed 1.4 billion shares exchanging hands on the New York Stock Exchange, where gainers topped decliners by 5 to 1. There were 925 million shares trading on the Nasdaq stock market, where gainers topped decliners by 3 to 1.
The market showed little reaction to the afternoon release of the Federal Reserve's Beige Book of economic conditions, which found the economy has weakened further since mid-March.
"The strength in commodities, combined with weakness in global equity markets, suggests investors are looking for a global slowdown but not a collapse in growth," said Tower of Covered Bridge Tactical. "If growth merely slows down globally, it still keeps the pressure on commodity prices."
A lack of surprises in consumer prices also helped boost sentiment for the market, given concerns that rising inflation will further dampen consumption, lift production costs, and prevent the Federal Reserve from cutting interest rates.
After virtually no change in February, the consumer price index in March rose 0.3%, matching estimates from analysts surveyed by MarketWatch. The core CPI, which excludes food and energy costs, rose 0.2% in March -- matching analysts' estimates -- after no growth in the prior month.
Better-than-expected March industrial production data also fueled early positive sentiment, rising 0.3% in March compared with economists' expectations for a 0.1% drop.
Weak housing data, meanwhile, failed to have much of an impact on the market. New construction of U.S. houses plunged to the lowest level in 17 years in March, the Commerce Department reported Wednesday.
The dollar remained under pressure against most major counterparts, notching a fresh low against the euro.
Stream of earnings
Also on the Dow, Coca-Cola gained 0.3%. The beverage giant reported a 19% profit rise during the first quarter, also topping forecasts.
International Business Machines , also a Dow component, rose 2.8% and eBay gained 1.7%, ahead of heir earnings reports after the close.
Merrill Lynch , which reports Thursday, rose 3.6%. The firm is expected to make a write-down between $6 billion and $8 billion, according to The Wall Street Journal.
The chief executive of Credit Suisse's investment banking division, Paul Calello, expects more write-downs though he said measures of investor risk and credit risk appetite are moving out of the "panic zone."
Elsewhere, France Telecom is reportedly considering a $54 billion bid for TeliaSonera in a deal that would need the support of the governments of France, Sweden and Finland.
Both the Nikkei 225 and the FTSE 100 in London rose strongly.
By Nick Godt