U.S. stocks snapped a four-day losing streak on Tuesday with Nasdaq notching its biggest gain in more than four years after news that Apple Inc was in talks to offer iPhones in China sent investors bargain hunting among battered technology stocks.

Reassurance from the chief executive of Goldman Sachs Group Inc that the investment bank does not face big credit losses helped ignite a rally in financial stocks, easing some worries about the breadth of the credit crisis.

Retailers also caught fire when surprisingly strong earnings from Wal-Mart Stores Inc and another big drop in oil prices eased worry about consumer spending on the doorstep of the holiday shopping season. U.S. oil futures ended below $92 a barrel.

The story of the day, though, was clearly the rebound in technology after a four-day drubbing that drove the Nasdaq down more than 8 percent. In addition to Apple, an upbeat outlook from Corning Inc, which makes glass for flat-screen televisions, also contributed to the turnaround in tech stocks.

Apple jumped 10.5 percent, the most in 14 months, while Corning climbed 10 percent, the most in 10 months. Goldman surged 8.5 percent, the most in 6-1/2 years, and Wal-Mart shot up 6.1 percent, the most in five years.

The market is extremely oversold. We like technology, said David Levy, portfolio manager of Kenjol Capital Management in Austin, Texas. Today you have leadership from the likes of Bank of America, Goldman and JPMorgan, all saying maybe things aren't as bad as everybody says it's going to be.

The Dow Jones industrial average surged 319.54 points, or 2.46 percent, to close at 13,307.09. The Standard & Poor's 500 Index gained 41.87 points, or 2.91 percent, to end at 1,481.05. The Nasdaq Composite Index shot up 89.52 points, or 3.46 percent, to finish at 2,673.65.

The session's advance marked the Dow's and the S&P 500's biggest climb since September 18, when the Federal Reserve cut interest rates by a larger-than-expected 50 basis points.

In the last hour of trading, stocks also got a boost from a report that showed a surprising rise in September pending home sales.

Apple led the tech sector's rebound following news that the company was talking to China Mobile Ltd, the world's largest wireless carrier, about offering its iPhones in China.

Apple shares finished up 10.5 percent at $169.96 on the Nasdaq, whose second-biggest advancer was BlackBerry maker Research In Motion Ltd (RIMM.O: Quote, Profile, Research), up 9.7 percent at $112.55.

Shares of Web search leader Google Inc, also among tech stocks bruised in the recent sell-off, ended up 4.5 percent at $660.55.

In the past four sessions, tech stocks took a heavy beating as investors worried that businesses would curb their spending.

Financials rallied following comments from Goldman Sachs Group Inc Chief Executive Lloyd Blankfein, who said at an industry conference that the investment bank expected no significant write-downs on assets.

Goldman shares jumped 8.5 percent to $233.04 on the NYSE, while those of Citigroup Inc, the biggest U.S. bank, advanced 6.9 percent to $35.90.

Shares of Bank of America Corp finished up 5.2 percent at $46.27 despite the No. 2 U.S. bank's forecast that it will write down $3 billion of debt in the fourth quarter as fallout from the nation's housing slump deepens.

Wal-Mart's stock gained 6.1 percent to $45.97 after the world's biggest retailer posted a stronger-than-expected quarterly profit and raised its outlook.

U.S. crude oil futures fell $3.45, or 3.7 percent, to settle at $91.17 per barrel in New York after an international agency forecast lower growth in world oil demand.

Volume was below average on the New York Stock Exchange, with about 1.66 billion shares changing hands, below last year's estimated daily average of 1.84 billion. On Nasdaq, about 2.66 billion shares traded, ahead of last year's daily average of 2.02 billion.

Advancing stocks outnumbered declining ones by a ratio of almost 5 to 1 on the NYSE and by about 7 to 3 on Nasdaq.

(Editing by Jan Paschal)