BRUSSELS (AP) — The excruciating work of inking a deal to contain their two-year debt crisis over, European leaders turned Thursday to a potentially more difficult task: implementing the agreement that asks banks to take on bigger losses on Greece’s debts and hopes to boost the region’s arsenal against market turmoil.

World stock markets surged Thursday on the news that the leaders had clinched a deal that everyone hopes will prevent the crisis from pushing Europe and much of the developed world back into recession and keep the currency union from unraveling. But analysts were more cautious, noting that the deal remains vague and its success hangs on the details.

In the predawn hours of Thursday, after the deal was unveiled, leaders claimed victory, but by evening, they were cautioning that their work has only begun.

“I think that yesterday we found a good overall package for the next stage, but I think that we still have many more stages to go,” German Chancellor Angela Merkel told reporters in Berlin.

Part of that work began Thursday when French President Nicolas Sarkozy called his Chinese counterpart Hu Jintao and pledged to cooperate to revive global growth. There was no word on whether Beijing might contribute to Europe’s bailout fund.

The fund’s chief executive is due to visit Beijing on Friday to talk to potential investors. Beijing has expressed sympathy for the 27-nation European Union, its biggest trading partner, but has yet to commit any cash.

The strategy unveiled after 10 hours of negotiations focused on three key points. These included a significant reduction in Greece’s debts, a shoring up of the continent’s banks, partially so they could sustain deeper losses on Greek bonds, and a reinforcement of a European bailout fund so it can serve as a euro1 trillion ($1.39 trillion) firewall to prevent larger economies like Italy and Spain from being dragged into the crisis.

After several missed opportunities, hashing out a plan was a success for the 17-nation eurozone, but the strategy’s effectiveness will depend on the details, which will have to be finalized in the coming weeks.

“The finer details still appear somewhat sketchy … but the prospect of a contagion and a disorderly default appear to have been put to one side for the time being,” said Michael Hewson, market analyst at CMC Markets. “The only concern is that this post-deal euphoria could well leave investors with a nasty hangover when they start to look at the fine print and realize that this solution could well be another sticking plaster.”

President Barack Obama, who had been increasingly pressuring Europe to get its act together in recent weeks, welcomed the plan — but pointedly noted that the U.S. was looking forward to its “full development and rapid implementation.”

The most difficult piece of the puzzle proved to be Greece, whose debts the leaders vowed to bring down to 120 percent of its GDP by 2020. Under current conditions, they would have ballooned to 180 percent.

To achieve that massive reduction, private creditors like banks will be asked to accept 50 percent losses on the bonds they hold. The Institute of International Finance, which has been negotiating on behalf of the banks, said it was committed to working out an agreement based on that “haircut,” but the challenge now will be to ensure that all private bondholders fall in line.

It said the 50 percent cut equals a contribution of euro100 billion ($139 billion) to a second rescue for Greece, although the eurozone promised to spend some euro30 billion ($42 billion) on guaranteeing the remaining value of the new bonds.

The full program is expected to be finalized by early December and investors are supposed to swap their bonds in January, at which point Greece is likely to become the first euro country ever to be rated at default on its debt.

“We can claim that a new day has come for Greece, and not only for Greece but also for Europe,” said Greek Prime Minister George Papandreou, whose country’s troubles touched off the crisis two years ago. “A burden from the past has gone, so that we can start a new era of development.”

Not all Greeks were convinced. Prominent left-wing deputy Dimitris Papadimoulis said the agreement would doom Greeks to a deeper recession.

“The deal puts Greece in a eurozone quarantine,” he said. “We are now locked in a system of continuous austerity, haphazard privatization, and continuous supervision by our creditors.”

He also noted an inherent conflict of interest in the plan.

“Those who monitor us do not have our interests in mind. Their priority is that we pay back our loans,” Papadimoulis said.

Since May 2010, Greece has been surviving on rescue loans worth euro110 billion ($150 billion) from the 17 countries that use the euro and the International Monetary Fund since it can’t afford to borrow money directly from markets.

In July, those creditors agreed to extend another euro109 billion — but that plan was widely panned as insufficient.

Now, in addition to euro30 billion in bond guarantees, the eurozone leaders and IMF said they will give Greece euro100 billion ($139 billion) in new loans.

With the banks being asked to shoulder more of the burden, though, there were concerns they needed more money in their rainy-day funds to cushion their losses. So European leaders have asked them to raise euro106 billion ($148 billion) by June.

The last piece in the complicated plan was to increase the firepower of the continent’s bailout fund to ensure that other countries with troubled economies — like Italy and Spain — don’t get dragged into the crisis. The third- and fourth-largest economies of the eurozone are too large to be bailed out like the smaller euro nations Greece, Portugal and Ireland have already been.

To that end, the euro440 billion ($610 billion) European Financial Stability Facility will be used to insure part of the potential losses on the debt of wobbly eurozone countries like Italy and Spain, rendering its firepower equivalent to around euro1 trillion ($1.39 trillion).

That should make those countries’ bonds more attractive investments and thus lower borrowing costs for their governments.

In addition to acting as a direct insurer of bond issues, the EFSF insurance scheme is also supposed to entice big institutional investors to contribute to a special fund that could be used to buy government bonds but also to help states recapitalize weak banks.

Such outside help may be necessary for Italy and Spain, whose banks were facing some of the biggest capital shortfalls.

On the markets, European trading was buoyant from the outset Thursday on the news. Britain’s FTSE climbed 2.9 percent to 5,712. Germany’s DAX jumped 4.9 percent to 6,311 and France’s CAC-40 gained 5.5 percent to 3,344. Shares in Asia posted solid gains earlier in the day.

___

Sarah DiLorenzo reported from Paris. Greg Keller and Sylvie Corbet in Paris, Juergen Baetz, David Rising and Geir Moulson in Berlin, Raf Casert, Don Melvin and Robert Wielaard in Brussels and Julie Pace in Washington contributed.