Stocks ended higher on Wednesday as the U.S. dollar fell and investors' appetite for risk returned, lifting shares of financial, technology and natural resource companies.

Stocks rebounded after falling two days in a row as the dollar rose. The greenback has been inversely correlated with equities since the S&P 500 stock index hit bottom in early March,

Weakness in the dollar late in the day, coupled with news that Citigroup is going to pay back their TARP assistance, both have given the market a little bit of support, said Peter Kenny, managing director at Knight Equity Markets in Jersey City, New Jersey. But it's probably more a function of the dollar than anything else.

Citigroup Inc plans to pay back the Treasury its rescue funds by raising money in a stock offering, cable television network CNBC reported. Analysts said the repayment would be another sign that banks were returning to health.

The Dow Jones industrial average <.DJI> ended up 51.08 points, or 0.50 percent, to 10,337.05. The Standard & Poor's 500 Index <.SPX> rose 3.95 points, or 0.36 percent, to 1,095.89. The Nasdaq Composite Index <.IXIC> gained 10.74 points, or 0.49 percent, to 2,183.73.

Since the stock market hit a bottom in early March, stocks and the dollar have had a strong inverse correlation. When the dollar falls, stocks tend to rise and vice versa.

That correlation partly reflects the so-called carry trade, whereby investors borrow a currency cheaply in order to invest in higher-yielding assets. The U.S. dollar index <.DXY> dropped 0.4 percent on Wednesday.

On the Nasdaq, Apple Inc shares ended up 4.2 percent to $197.80 after Oppenheimer said in a note that the iPod, iPhone and Mac maker is preparing to launch a tablet personal computer in late March or April.

Treasury Secretary Timothy Geithner said the government would extend its $700 billion financial bailout fund to October 2010 for further efforts to fight home foreclosures and to ease credit for small businesses in the hopes of spurring job growth.

The extension could help medium and small banks, analysts said. Capital One gained 2.7 percent to $38.61 and Zions Bancorp ended up 1.8 percent at $13.98.

The KBW bank index <.BKX> gained 0.3 percent, while the S&P financial index <.GSPF> was up 0.5 percent.

In the materials sector, shares of U.S. Steel Corp jumped 5.7 percent to $46.74, while aluminum company Alcoa Inc gained 1.6 percent to $13.08.

Lifting the Dow was 3M Co , which ended up 3.4 percent at $79.74 after Citigroup upgraded the manufacturer's stock.

On the downside, Texas Instruments fell 1.3 percent to $25.99 a day after it gave a fourth-quarter earnings view that disappointed some investors who had hoped for signs of improving demand.

Stocks fell early in the session on news Standard & Poor's revised its outlook on Spain's credit to negative, a day after Fitch Ratings downgraded Greece's debt. The moves came amid fears that Dubai's debt problems could spread to other parts of the Gulf region.

Volume was light on the New York Stock Exchange, with 1.08 billion shares changing hands, below last year's estimated daily average of 1.49 billion, while on the Nasdaq, about 1.92 billion shares traded, also below last year's daily average of 2.28 billion.

Advancing stocks outnumbered declining ones on the NYSE by a ratio of 16 to 13, while on the Nasdaq, advancers and decliners were about even. (Editing by Kenneth Barry) Keywords: MARKETS STOCKS