Stocks were modestly higher on Tuesday after data showed existing home sales declined less than expected in February, while healthcare stocks gave back some gains from the previous session.

The National Association of Realtors said sales fell to an annual rate of 5.02 million units, highlighted the fragility of a housing recovery.

Our view is that housing is bottoming and beginning a slow improvement, but we're going to bounce along the bottom for a while. It won't be any different from the previous cycle in the 1980s, said Henry Smith, chief investment officer at Haverford Trust Co in Philadelphia.

Healthcare stocks were among the laggards the day after the U.S. House of Representatives approved a bill to overhaul healthcare. The Morgan Stanley Healthcare Payor index <.HMO> dropped 0.7 percent, and Centene Corp , a smaller insurer specialized in Medicaid plans, was down 1.4 percent at $23.80.

The Dow fared better than the other two big indexes as Caterpillar Inc gained 3.1 percent to $61.81. Wells Fargo raised its 12- to 18-month stock target to $73 to $75 from $63 to $65.

Baidu Inc jumped 3 percent to $597.14 after rival Google Inc shut down its mainland Chinese portal and began rerouting searches to its Hong Kong operation.

The Dow Jones industrial average <.DJI> rose 35.98 points, or 0.33 percent, to 10,821.87. The Standard & Poor's 500 Index <.SPX> added 1.54 points, or 0.13 percent, to 1,167.35. The Nasdaq Composite Index <.IXIC> was up 3.82 points, or 0.16 percent, at 2,399.22.

Separate data showed home prices declined 1.8 percent from last year.

(Additional reporting by Ryan Vlastelica; editing by Jeffrey Benkoe)