Updated from 4:17 p.m. EST

Stocks rallied Monday as a strong upside preannouncement from IBM ( IBM) put investors in a buying mood at the start of a big earnings week.

The Dow Jones Industrial Average gained 171.85 points, or 1.36%, to 12,778.15, and the S&P 500 rose 15.23 points, or 1.09%, to 1416.25. The tech-heavy Nasdaq Composite surged 38.36 points, or 1.57%, to 2478.30.

"This was a technical bounce with some good news behind it," said Edgar Peters, chief investment officer with Pan Agora. "The market has been down for so many days, it was bound to go higher. There are still problems with inflation and economic data to come but, for now, this means that the panic selling is over."

Volume and breadth were both strong to start the week. About 3.57 billion shares changed hands on the New York Stock Exchange, with advancers topping decliners by a 2-to-1 margin. Volume on the Nasdaq reached 2.11 billion shares, as winners edged losers 3 to 2.

IBM jumped 5.4% to end the session at $102.93 after the company offered preliminary figures for the fourth quarter that were well above Wall Street's estimates. IBM is set to report its full results after Thursday's close.

In addition to IBM, shares of tech giants Hewlett-Packard ( HPQ), Intel ( INTC) and Cisco ( CSCO) each gained 2.5% or more.

"Things don't look as bleak as they have earlier this year," said Robert Pavlik, chief investment officer with Oaktree Asset Management. "IBM is helping to offset concerns over weak economic news. This gives some added stability to tech and those with exposure to overseas markets."

Elsewhere, Citigroup ( C) is expected to write off up to $24 billion related to subprime losses in its fourth-quarter report, according to CNBC. The firm may also be forced to cut 20,000 jobs and may slash its dividend.

Citigroup, which will post fourth-quarter results Tuesday, gained 50 cents, or 1.8%, to $29.06.

"The Citigroup news is positive in that it shows that financials are really trying to wash out these subprime issues," said Pavlik. "The more writedowns we take now, the better of we'll be later on. It'll be that much less exposure to have to continue to write off in future quarters."

Along with Citigroup, several financial names will be in focus this week amid a flurry of earnings reports. JPMorgan Chase ( JPM), Wells Fargo ( WFC), Merrill Lynch ( MER), Washington Mutual ( WM) and several other banks and lenders will post results in the coming days.

Meanwhile, Sears Holdings ( SHLD) was one of few laggards, falling 5% to $91.38 after the retailer said it expects fourth-quarter earnings to drop more than 50% from a year ago and come in below the consensus estimate.

The warning came after weak holiday same-store sales. Credit Suisse downgraded shares of Sears Holdings all the way to underperform from outperform on the news.

On the other hand, the firm upgraded several retailers. Bed Bath & Beyond ( BBBY), Home Depot ( HD) and Lowe's ( LOW) were all raised to outperform from neutral. All three stocks ended higher by 2% or more.

In other corporate news, Apple ( AAPL) was in focus ahead of the annual MacWorld conference, where the company typically unveils new products. Shares rose 3% to $177.86.

Away from equities, commodity futures were on the rise. Oil advanced $1.51 to $94.20 a barrel. Gold surged again to record levels, up $5.70 to close at $903.40 an ounce.

U.S. Treasury prices were slightly higher after a volatile session. The 10-year note was up 1/32 in price, yielding 3.78%. The 30-year bond tacked on 3/32 in price, yielding 4.37%. The dollar, meanwhile, was losing ground against the world's major currencies.

Last time out, stocks closed a losing week on a sour note following more worries about consumer credit and spending.

The Dow slid 246.79 points, or 1.92%, to 12,606.30, and the S&P 500 fell 19.31 points, or 1.36%, to 1401.02. The Nasdaq dropped 48.58 points, or 1.95%, to close at 2439.94.

Overseas markets were mixed. In Asia, Hong Kong's Hang Seng was lower by 1.5%, while in Europe London's FTSE 100 tacked on 0.2% and Germany's Xetra Dax was higher by 0.2%.

More from Markets

Billionaire Investor Tim Draper Explains Why Bitcoin Will Hit $250,000 in 2022

Billionaire Investor Tim Draper Explains Why Bitcoin Will Hit $250,000 in 2022

To Think a Trade War's Still Just a Threat Is the Dumbest Thing on Wall Street

To Think a Trade War's Still Just a Threat Is the Dumbest Thing on Wall Street

M&A Trends Still on Investors' Minds Despite Worries Over Tariffs -- ICYMI

M&A Trends Still on Investors' Minds Despite Worries Over Tariffs -- ICYMI

Dow Falls as U.S. Imposes Tariffs on $50 Billion of Chinese Goods

Dow Falls as U.S. Imposes Tariffs on $50 Billion of Chinese Goods

General Motors Spikes on Report It's Considering Listing Shares of Cruise Unit

General Motors Spikes on Report It's Considering Listing Shares of Cruise Unit