Stocks turned lower on Thursday as initial enthusiasm faded over a long-stalled Greek deal and data indicating an improving U.S. labor market.

Leaders from major Greek parties had agreed on reforms and austerity measures needed in exchange for a new bailout package to avoid a chaotic default, sources said.

Also bolstering the tone was a report showing jobless claims fell last week, underscoring a firming in the labor market. That followed a better-than-expected payrolls report last week.

But gains sparked by the news from Greece were somewhat muted as stocks have been decoupling from events in Europe this year, leaving the possibility for investors to book some profits as the S&P 500 has risen more than 7 percent year to date.

There is definitely a whiff of 'sell on the news' in the air, just given the claims number and the Greek deal. We've climbed this wall of worry and the first reaction for people is to hit the sell button, said Michael Marrale, managing director and head of sales trading at RBC Capital Markets in New York.

It's tough to find any real reasons to sell here that haven't been fully flushed out in the marketplace outside of the move we've made.

The Dow Jones industrial average <.DJI> rose 11.81 points, or 0.09 percent, at 12,895.76. The Standard & Poor's 500 Index <.SPX> was down 0.64 points, or 0.05 percent, at 1,349.32. The Nasdaq Composite Index <.IXIC> was down 1.05 points, or 0.04 percent, at 2,914.81.

European shares extended gains on the Greece news, with the FTSEurofirst 300 <.FTEU3> index of top European shares up 0.5 percent.

The European Central Bank held its main interest rate at 1.0 percent, but markets were watching to see whether the bank is ready to help Greece avoid a messy default.

The Bank of England voted to inject another 50 billion pounds into the financial system as part of its efforts to shore up a fragile recovery.

Data from the Commerce Department showed wholesale inventories in December rose 1 percent versus expectations calling for a rise of 0.4 percent as companies restocked shelves.

PepsiCo Inc
fell 4.3 percent to $63.84 after the beverage maker posted higher quarterly profit, said it will cut 8,700 jobs and spend $500 million to $600 million to boost sales in North America.

Cisco Systems Inc posted second-quarter results that beat estimates after the close Wednesday and hiked its quarterly dividend. Shares was off 2.4 percent to $19.93.

Groupon Inc slumped 10.4 percent to $22.05. The daily deal website's posted an unexpected loss in the first quarterly report since it went public.

Diamond Foods Inc tumbled 36.7 percent to $23.15 after the company removed its top management and said it would restate results due to improper accounting of payments to walnut growers.

Other companies expected to post results Thursday include Expedia Inc Pitney Bowes Inc
and Philip Morris International Inc
.

Taleo Corp surged 17 percent to $45.57 after Oracle Corp said it would buy the recruitment software maker for about $1.9 billion. Oracle dipped 0.4 percent to $28.63.

(Reporting By Chuck Mikolajczak; editing by Jeffrey Benkoe)