Greece took an important step towards its second bailout after it managed to win a crucial debt swap, European leaders have said.

The Greek deal with banks and other lenders is the largest restructuring of government debt in history.

Some lenders who lost money as a result of the debt swap will be compensated.

That is after the International Swaps and Derivatives Association classified the deal as a "credit event", triggering insurance payments.

Under the debt swap, banks and other financial institutions have agreed to exchange their existing Greek government debt for new bonds, which are worth much less and pay a lower rate of interest.

Some investors bought a type of insurance against that happening. Those payouts could be worth in total up to $3.2bn, only a small fraction of the 105bn euros ($138bn, £88bn) wiped-off Greece's debt burden.

The credit ratings agency, Moody's declared Greece in default on its debt on Friday.

It said the terms of the debt swap met its definition of a default.

The company says it will assess the affect of the latest bailout before it assigns Greece a new rating.

'Problem solved'

Eurozone finance ministers said the conditions were now in place for the country to receive its new 130bn-euro (£110bn; $173bn) bailout.

"Today the problem is solved," French President Nicolas Sarkozy said.

Greek Finance Minister Evangelos Venizelos hailed the swap as an "exceptional success".

In a statement after a conference callof finance ministers, Jean-Claude Juncker, president of the 17-nation eurogroup, said "the necessary conditions are in place to launch the relevant national procedures required for the final approval" of its bailout.

Finance ministers from the eurozone nations meet on Monday and are expected to officially sign off on Greece's second bailout.

Mr Sarkozy, who faces an election next month, added: "I would like to say how happy I am that a solution to the Greek crisis, which has weighed on the economic and financial situation in Europe and the world for months, has been found."

Holders of 85.8% of debt who are subject to Greek law and 69% of its international debt holders agreed a debt swap, according to the finance ministry.

Athens needed to get 75% to push through the deal. The European Union and International Monetary Fund (IMF) said that if the debt swap did not go through Greece would not get its latest bailout.

EU economic affairs commissioner Olli Rehn said he was pleased with the deal but expected Greece to maintain its focus on austerity.

"I am very satisfied by the large positive turnout of the voluntary debt exchange in Greece," he said.

And a spokesman for German Chancellor Angela Merkel said take-up was "encouraging".

'Historic endeavour'

IMF head Christine Lagarde said it was "an important step that will dramatically reduce Greece's medium-term financing needs and contribute to debt sustainability".

The IMF will meet on 15 March to decide what it will contribute to the eurozone bailout.

Mr Venizelos told Greece's parliament on Friday that the debt swap - which cuts Greece's debts by around 105bn euros - meant it was a "good day" for Greece.

"We have achieved an exceptional success... and I believe everyone will soon realise that this is the only way to keep the country on its feet, and give it the second historic chance that it needs," he said.

The Greek government has promised to continue implementing austerity measures demanded by the EU and IMF.

So far the deal involves 172bn euros worth of debt,according to the Greek government website, with investors taking a total loss of up to 74%.

Market reaction to the news was subdued on Friday with little change on most European markets.

Stock exchanges had rallied strongly on Thursday on hopes that the deal would go through - with the stock market in Athens up more than 3% and the markets in Paris and Frankfurt also higher.

Greece said it had extended the deadline for bond holders not governed by Greek law to sign up until 23 March.

The deal was also welcomed by representatives of private sector lenders to Greece, who said it paved the way for agreement on the EU bailout.

"The very strong and positive result provides a major opportunity now for Greece to move ahead with its economic reform program, while strengthening the euro area's ability to create an economic environment of stability and growth," said Josef Ackermann, chairman of the International Institute of Finance, which represents private lenders.

Austerity cuts

The news comes as the latest GDP figures for Greece showed the economy contracted by 7.5% in the final three months of 2011.

The revised figures are worse than the previously estimated 7%.

The weak economic data comes ahead of a further round of austerity measures.

The government is pushing through spending cuts equal to 1.5% of its output, including cuts in pensions and civil service job cuts.

It has also been told to make its economy more competitive by cutting the minimum wage and making labour markets more flexible.

The aim is to cut the Greek government's debt from 160% of GDP to a little over 120% of GDP by 2020.

Some economists fear further austerity measures will damage the economy, increasing the chance Greece will require more bailouts or debt write-offs.

Others argue the economy will become more competitive, attracting investment and generating jobs.

"This does not mean the debt situation in Greece is resolved, and this is not the last time we will be hearing about this. But it is a relief that it didn't go the other way. It could have been a lot worse," said Tim Ghriskey, chief investment officer at Solaris Group in New York.