Stocks ended higher on Wednesday, reversing earlier losses, as a weaker dollar fueled appetite for riskier assets, boosting shares of financial, technology and natural resource companies.

Stocks rebounded after falling two days in a row, triggered by concerns about foreign debt and a rise in the dollar as investors sought a safe haven.

It's mainly the reversal of the dollar after a couple sessions of sell-off, said Marc Pado, U.S. market strategist at Cantor Fitzgerald & Co in San Francisco.

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.

The U.S. dollar index <.DXY>, which has been inversely correlated with equities since the S&P 500 hit bottom in early March, dropped 0.4 percent.

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.

The tablet is expected to pitch Apple into the digital book market popularized by Amazon.com's Kindle e-reader.

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.

(Editing by Kenneth Barry)