NEW YORK (AP) -- The stock market finally got the deal it wanted from Greece on Thursday, but investors weren't sure what to think of it.
U.S. stocks rose in the morning after Greece announced an agreement to cut costs and keep from defaulting on its debt next month, an event that could have shocked the world financial system.
Stocks dropped back later in the morning and were flat at midday. Though the Greek agreement churned up plenty of headlines, analysts cautioned that the market had already expected the deal and warned that Europe still faced problems.
By afternoon, stocks were gently rising again. The Dow Jones industrial average was up 21 points at 12,905. The Standard & Poor's 500 index was up three at 1,353. The Nasdaq composite index was up 13 at 2,928.
Earlier in the day, the Dow was as high as 12,924.71, its highest level during a trading day since May 20, 2008. That was also the last day the average traded above 13,000.
The S&P's gain took it to double its level on March 9, 2009, the low for stocks during the Great Recession. It last closed at double the low last July. The Nasdaq is trading at its highest level since December 2000.
Jeremy Zirin, chief equity strategist at UBS Wealth Management, said that the markets had already assumed Greece would reach a deal to keep from defaulting, which is why stocks didn't skyrocket on the news.
The deal calls for Greece to make steep cuts in government jobs and spending. Greece's so-called troika of lenders -- the European Union, the European Central Bank and the International Monetary Fund -- insisted on the cuts.
The cuts are one condition of a €130 billion bailout for Greece, without which it can't afford €14.5 billion worth of bond payments due March 20.
But the cuts will be hard to implement in a country that has grown used to profligate government spending. Workers are already protesting that job cuts and pay cuts have already been too severe.
The country has missed other targets for reducing its debts. It also still has to persuade private investors to agree to losses on their holdings, which will make them less likely to buy Greek bonds in the future.
And other European countries, notably Portugal and Italy, still have long-term debt that economists warn could be unsustainable.
"We still have a lot of wood to chop," Zirin said.
Nigel Travis, CEO of Dunkin' Brands, said the news out of Greece will be a psychological boost for consumers. And when they feel good about the economy, they're more likely to spend, regardless of whether their wealth is directly affected.
But Travis, whose company runs Dunkin' Donuts and Baskin-Robbins, said Greece wasn't the most pressing problem facing his franchisees. They're more concerned about the U.S. presidential election and getting clarity on changes to government-funded small-business loans and whether a cut in the Social Security payroll tax will be extended.
"I think it's good news," Travis said of the Greece deal. "Whether it actually solves the euro problem, you have to question."
The euro rose half a cent against the dollar to $1.33, its highest level in two months. Bond prices fell slightly. The yield on the U.S. government's benchmark 10-year note rose to 2.05 percent from 1.99 percent Wednesday.
Stocks were also helped Thursday by U.S. jobs data. The number of people seeking unemployment assistance fell to its lowest level since April 2008.
Apple closed in on $500 per share and set an all-time high after reports that it will unveil the iPad 3 at an event in March. The stock has been on a tear for six weeks, rising 22 percent since the start of the year and securing Apple's place, at least for now, as the world's most valuable company by market cap, ahead of Exxon Mobil.
Last month, the company that transformed how Americans listen to music, check email and share photos announced that sales of the iPhone and iPad more than doubled in the last three months of last year. Apple stock was at $494, up almost 4 percent, after touching a record high of $496.75.
But other stocks didn't fare so well. Among losers for the day:
-- Diamond Foods, maker of Emerald Nuts and Pop Secret popcorn, plunged 28 percent. It announced late Wednesday that it was ousting its top two executives amid allegations of improper accounting.
-- Groupon, the daily deal website, fell 17 percent after it announced a surprising quarterly loss in its first earnings report as a public company.
-- TripAdvisor, the website where travelers can post advice and reviews, lost 15 percent after it missed analysts' expectations for earnings and revenue. Like Groupon, TripAdvisor was also making its first earnings report as a public company. The website spun off from Expedia in December.
-- PepsiCo fell 3 percent after announcing it will cut 3 percent of its workforce, a defense against higher costs for materials.