The Dow and S&P 500 edged higher on Friday, led by gains in energy and healthcare stocks.

Healthcare stocks rebounded after a selloff during the past two days as investors feared the impact on profits from the new healthcare overhaul law. The S&P healthcare index <.GSPA> was up 0.7 percent.

Merck & Co was up 4.9 percent at $35.43, the top gainer on the Dow. The company said its costs related to U.S. healthcare reform will be a far smaller percentage of total company sales compared with rival drugmakers.

Higher oil prices, which rose above $85 a barrel, boosted energy shares, sending the S&P energy index <.GSPE> up 1.2 percent.

The Nasdaq was pressured by Microsoft Corp Inc , which fell 2.3 percent to $30.68 after the company reported earnings late on Thursday.

The Dow Jones industrial average <.DJI> was up 21.62 points, or 0.19 percent, at 11,155.91. The Standard & Poor's 500 Index <.SPX> was up 2.28 points, or 0.19 percent, at 1,210.95. The Nasdaq Composite Index <.IXIC> was down 2.64 points, or 0.10 percent, at 2,516.43.

Surprisingly strong earnings have contributed to stocks' gains in recent weeks, and the benchmark S&P 500 is up 77 percent from the March lows in 2009.

Weighing on the market was worry about sovereign debt risk from the economically weaker euro zone countries and the possible impact on the global economic recovery. Debt-stricken Greece appealed to its European partners and the International Monetary Fund for emergency loans on Friday.

This is a double-edge sword. It's positive in a sense that it will provide a short-term relief, but on the negative side, investors are now concerned that this might spread to weaker countries in Europe, said Peter Cardillo, chief market economist at Avalon Partners in New York.

American Express Co helped the Dow index, rising more than 3.6 percent to $48.47 a day after it said net income more than doubled.

Home builders <.DJUSHB> were also up 3.3 percent after data showed sales of newly built U.S. single-family homes rose last month to their highest level in eight months, the government said.

But Travelers Companies shares fell 1.2 to $53.15 after the largest publicly traded U.S. property-casualty insurer reported a lower-than-expected first-quarter profit.

(Reporting by Angela Moon, Editing by Kenneth Barry)