Stocks rose on Tuesday as an upbeat report on sales of previously owned U.S. homes bolstered hopes for an economic recovery.

But a sell-off in financials, sparked by worries about the dilutive impact of recent stock offerings, kept the market's gains in check.

Investors snapped up shares of home builders, with Toll Brothers rising 3.4 percent to $19.43, while DR Horton shot up 5.1 percent to $9.72. The Dow Jones home construction index <.DJUSHB> was up 3.3 percent.

Shares of big manufacturers also rose, with plane maker Boeing Co , up 3.5 percent, among the Dow's major advancers. Exxon Mobil Corp and McDonald's Corp also bolstered the Dow.

A drop in the U.S. dollar against major foreign currencies also buoyed the shares of multinational companies. The dollar hit fresh lows against the euro on Tuesday as strong housing data weakened its safe-haven appeal.

Pending sales of previously owned U.S. homes shot up 6.7 percent in April, the biggest monthly gain in 7-1/2 years, according to the National Association of Realtors.

Some news is starting to come out that says things are stabilizing and slowly starting to look better, said Dan Faretta, senior market strategist at Lind-Waldock, a retail brokerage firm, in Chicago. We've still got companies going under, filing for bankruptcy, and unemployment is continuing to rise ... but we are starting to finally hit the bottom.

The Dow Jones industrial average <.DJI> gained 50.64 points, or 0.58 percent, to 8,772.08. The Standard & Poor's 500 Index <.SPX> gained 5.37 points, or 0.57 percent, to 948.24. The Nasdaq Composite Index <.IXIC> gained 13.66 points, or 0.75 percent, to 1,842.34.

Trading was volatile, with indexes swinging between gains and losses earlier in the session.

The broader market came up against critical resistance a day after the S&P 500 hit a key technical milestone, finishing above its 200-day moving average for the first time since December 2007. Since hitting a 12-year low on March 9, the S&P 500 has risen about 40 percent.

Boeing shares rose 3.4 percent to $49.34, while Exxon Mobil climbed 1.6 percent to $72.88, and McDonald's gained 1.3 percent to $60.65.

On Nasdaq, shares of Oracle Corp rose 2.3 percent to $20.38 after Chief Executive Larry Ellison said he is considering getting into the business of selling low-cost laptop computers, one of the fastest-growing sectors of the technology business.

Several U.S. banks are raising capital to show they are capable of functioning without government support, in a move to free themselves from tight regulations after they received billions of dollars from the Treasury Department's Troubled Asset Relief Program, or TARP. [ID:nN02502975]

Shares of JPMorgan , which sold $5 billion of stock, fell 3.2 percent to $34.95, putting the bank among the Dow's top drags. Shares of American Express Co dropped nearly 4 percent to $24.96 after the credit card company sold $500 million of stock. The KBW bank index <.BKX> fell 0.8 percent.

(Reporting by Ellis Mnyandu; Editing by Jan Paschal)