The Greek government and financial markets were cheered on Tuesday by an agreement between euro zone finance ministers and the International Monetary Fund to reduce Greece's debt, paving the way for the release of urgently needed aid loans.

The deal, clinched at the third attempt after weeks of wrangling, removes the biggest risk of a sovereign default in the euro zone for now, ensuring the near-bankrupt country will stay afloat at least until after a 2013 German general election.

"Tomorrow, a new day starts for all Greeks," Prime Minister Antonis Samaras told reporters at 3 a.m. in Athens after staying up to follow the tense Brussels negotiations.

After 12 hours of talks, international lenders agreed on a package of measures to reduce Greek debt by more than 40 billion euros, projected to cut it to 124 percent of gross domestic product by 2020.

In an additional new promise, ministers committed to taking further steps to lower Greece's debt to "significantly below 110 percent" in 2022.

That was a veiled acknowledgement that some write-off of loans may be necessary in 2016, the point when Greece is forecast to reach a primary budget surplus, although Germany and its northern allies continue to reject such a step publicly.

Analyst Alex White of JP Morgan called it "another moment of 'creative ambiguity' to match the June (EU) Summit deal on legacy bank assets; i.e. a statement from which all sides can take a degree of comfort".

The euro strengthened, European shares climbed to near a three-week high and safe haven German bonds fell on Tuesday, after the agreement to reduce Greek debt and release loans to keep the economy afloat.

"The political will to reward the Greek austerity and reform measures has already been there for a while. Now, this political will has finally been supplemented by financial support," economist Carsten Brzeski of ING said.

As for the former, this is certainly up in the air. The fragile coalition in place now could fly apart if social unrest gets any worse, thus losing consensus on austerity.

And there is absolutely no guarantee of the latter. The economy is in a depression and capital is fleeing the country. It's hard to see how an economy can grow with so much working against it.

But the EU is congratulating itself for avoiding disaster - for the moment. How things look in 2-4 years is anyone's guess. We may very well be back to square one with Greece and it's potential to kill the EU.

The EU, IMF, and Greece have struck a deal to write down 40 billion euros in debt that will free up funds to help the country pay its bills.

Not exactly can kicking, but Greece is certainly not out of the woods yet.

The Greek government and financial markets were cheered on Tuesday by an agreement between euro zone finance ministers and the International Monetary Fund to reduce Greece's debt, paving the way for the release of urgently needed aid loans.

The deal, clinched at the third attempt after weeks of wrangling, removes the biggest risk of a sovereign default in the euro zone for now, ensuring the near-bankrupt country will stay afloat at least until after a 2013 German general election.

"Tomorrow, a new day starts for all Greeks," Prime Minister Antonis Samaras told reporters at 3 a.m. in Athens after staying up to follow the tense Brussels negotiations.

After 12 hours of talks, international lenders agreed on a package of measures to reduce Greek debt by more than 40 billion euros, projected to cut it to 124 percent of gross domestic product by 2020.

In an additional new promise, ministers committed to taking further steps to lower Greece's debt to "significantly below 110 percent" in 2022.

That was a veiled acknowledgement that some write-off of loans may be necessary in 2016, the point when Greece is forecast to reach a primary budget surplus, although Germany and its northern allies continue to reject such a step publicly.

Analyst Alex White of JP Morgan called it "another moment of 'creative ambiguity' to match the June (EU) Summit deal on legacy bank assets; i.e. a statement from which all sides can take a degree of comfort".

The euro strengthened, European shares climbed to near a three-week high and safe haven German bonds fell on Tuesday, after the agreement to reduce Greek debt and release loans to keep the economy afloat.

"The political will to reward the Greek austerity and reform measures has already been there for a while. Now, this political will has finally been supplemented by financial support," economist Carsten Brzeski of ING said.

As for the former, this is certainly up in the air. The fragile coalition in place now could fly apart if social unrest gets any worse, thus losing consensus on austerity.

And there is absolutely no guarantee of the latter. The economy is in a depression and capital is fleeing the country. It's hard to see how an economy can grow with so much working against it.

But the EU is congratulating itself for avoiding disaster - for the moment. How things look in 2-4 years is anyone's guess. We may very well be back to square one with Greece and it's potential to kill the EU.