Stocks edged lower on Friday as investors paused after a rally that lifted the S&P 500 index almost 20 percent from near bear market levels where it had sunk earlier this month.

Stock indexes had soared 3 percent in the previous session after a deal on European debt. The S&P index closed above its 200-day moving average for the first time since August, a sign of an improving trend for stocks after five straight months of losses.

Thursday's gains came after European Union leaders struck a long-awaited agreement to help contain Europe's two-year debt crisis.

Concerns that the euro zone debt crisis would spread and erode domestic bank profits have contributed to recent weakness in stocks, with the S&P at one point dipping into bear market territory, defined as a 20 percent decline from a recent peak, in intraday trading on October 4.

The S&P 500 now is up more than 13 percent this month, on pace for its biggest monthly gain since October 1974.

Some investors remained skeptical over the debt deal as many details were still to be worked out before the EU can show its can contain the crippling sovereign debt crisis.

When you're up about 20 percent in 18 days, and coming off a 3 percent move, you have to catch your breath, said Mike Gibbs, managing director and chief market strategist at Morgan Keegan in Memphis, Tennessee.

The head of Europe's bailout fund played down hopes of a quick deal with China for that country to throw its support behind efforts to resolve the crisis but said he expects Beijing to continue to buy bonds issued by the rescue fund.

There are still a lot of unanswered questions about the plan and what happens next, so we'll probably be in a trading range for a while, but this is a win for bulls that the market is holding on today, Gibbs said.

The Dow Jones industrial average was down 11.65 points, or 0.10 percent, at 12,196.90. The Standard & Poor's 500 Index was down 4.09 points, or 0.32 percent, at 1,280.50. The Nasdaq Composite Index was down 10.96 points, or 0.40 percent, at 2,727.67.

Hewlett-Packard Co led the Dow higher, rising 2.3 percent to $27.62 a day after it said it was ditching a plan to spin off its personal computers unit, a plan that was expected to have cost billions of dollars in expenses and lost business.

A pair of stronger-than-expected earnings from Dow components also contributed to the blue chip index's modest gains. Merck & Co Inc rose 1.8 percent to $34.93 after its profit and sales beat analyst estimates, and Chevron Corp's profit more than doubled. The stock rose 0.3 percent to $109.

MF Global Holdings Ltd fell 2.8 percent to $1.39, well off earlier lows. Some customers are moving money away from the futures brokerage, rivals, hedge fund officials and analysts said, though the extent of the outflows is unclear.

Economic data on Friday showed U.S. consumer sentiment improved in October for the second month in a row as consumers felt more upbeat about the economy's prospects.

(Editing by Kenneth Barry)