Stocks rose on Wednesday after the U.S. Federal Reserve said it will keep interest rates near zero and ahead of President Barack Obama's State of the Union address tonight.

But the Nasdaq got a late surge from a gain of almost 1 percent in the shares of Apple Inc after the iPad's debut.

Market analysts said the Fed's decision was not surprising, but the somewhat more optimistic tone of its statement shifted sentiment after a wave of unexpected news from Washington the past two weeks caused the stock market to buckle.

The market rallied because there wasn't anything overtly negative that could be taken from the Fed statement, said Michael James, senior trader at regional investment bank Wedbush Morgan in Los Angeles.

We've been hit by so many negative bits of news (lately), whether from Washington or China, that there was some relief that there wasn't anything overtly negative that could be construed from the Fed statement.

The Dow Jones industrial average <.DJI> gained 41.87 points, or 0.41 percent, to end at 10,236.16. The Standard & Poor's 500 Index <.SPX> rose 5.33 points, or 0.49 percent, to 1,097.50. The Nasdaq Composite Index <.IXIC> climbed 17.68 points, or 0.80 percent, to 2,221.41.

After the closing bell, Qualcomm Inc tumbled 8.9 percent to $43.00 after the biggest maker of cellphone chips cut its revenue estimate for the first quarter and current fiscal year, citing a slow economic recovery.

During the regular session, Apple's shares rose 0.9 percent to $207.88, reversing course from a drop of more than 3 percent earlier in the day after the company unveiled its iPad tablet computer.

The Nasdaq also got a boost from Gilead Sciences Inc , which jumped 7.1 percent to $48.04 after the biotech company posted fourth-quarter earnings that topped Wall Street's estimates and forecast a sales increase of about 10 percent for 2010. The NYSE Arca Biotech index <.BTK> gained 1.3 percent.

Boeing was the Dow's top advancer, up 7.3 percent at $61.93 after the world's second-largest aircraft manufacturer reported stronger-than-expected quarterly results and forecast a profitable 2010.

But Dow components Caterpillar and United Technologies Inc slipped after giving cautious forecasts.

Caterpillar's shares slid 4.3 percent to $53.44, while United Tech's stock lost 1.3 percent to $67.61.

The U.S. president's first State of the Union address is scheduled to be broadcast live, beginning at 9:00 p.m. tonight.

Volume was light on the New York Stock Exchange, with about 1.3 billion shares changing hands, below last year's estimated daily average of 2.18 billion. On the Nasdaq, about 2.49 billion shares traded, above last year's daily average of 1.63 billion.

Advancing stocks just barely outnumbered declining ones on the New York Stock Exchange, with 1,517 shares rising and 1,515 falling. On the Nasdaq, the winner's advantage was more pronounced, with about 16 stocks rising for every 11 that fell.

(Reporting by Chuck Mikolajczak; Additional reporting by Caroline Valetkevitch; Editing by Jan Paschal)