After 12 hours of talks at their third meeting in as many weeks, Greece's international lenders agreed on a package of measures to reduce Greek debt by €40 billion, cutting it to 124 % of gross domestic product by 2020.
>> Read: Eurogroup statement on Greece
In a significant new pledge, ministers committed themselves to take further steps to lower Greece's debt to "significantly below 110%" in 2022 - the most explicit recognition so far that some write-off of loans may be necessary from 2016, the point at which Greece is forecast to reach a primary budget surplus.
"When Greece has achieved, or is about to achieve, a primary surplus and fulfilled all of its conditions, we will, if need be, consider further measures for the reduction of the total debt," German Finance Minister Wolfgang Schäuble said.
Eurogroup Chairman Jean-Claude Juncker said ministers would formally approve the release of a major aid installment needed to recapitalise Greece's teetering banks and enable the government to pay wages, pensions and suppliers on Dec. 13.
Greece will receive up to €43.7 billion in stages as it fulfills the conditions. The December installment will comprise €23.8 billion for banks and €10.6 billion in budget assistance.
The IMF's share, less than a third of the total, will only be paid out once a buy-back of Greek debt has occurred in the coming weeks, but IMF Managing Director Christine Lagarde said the Fund had no intention of pulling out of the programme.
To reduce Greece's debt pile, ministers agreed to cut the interest rate on official loans, extend their maturity by 15-30 years, and grant Athens a 10-year interest repayment deferral.
They promised to hand back €11 billion in profits accruing to their national central banks from European Central Bank purchases of discounted Greek government bonds in the secondary market.
They also agreed to finance Greece to buy back its own bonds from private investors at what officials said was a target cost of around 35 cents in the euro.
European Central Bank President Mario Draghi said on leaving the talks: "I very much welcome the decisions taken by the ministers of finance. They will certainly reduce the uncertainty and strengthen confidence in Europe and in Greece."
The euro strengthened against the dollar after news of the deal was first reported by Reuters. Juncker said the accord opened new hope for Greeks.
"This is not just about money. This is the promise of a better future for the Greek people and for the euro area as a whole, a break from the era of missed targets and loose implementation towards a new paradigm of steadfast reform momentum, declining debt ratios and a return to growth," he told a 2am news conference.
Greek Finance Minister Yannis Stournaras said earlier that Athens had fulfilled its part of the deal by enacting tough austerity measures and economic reforms, and it was now up to the lenders to do their part.
Greece, where the eurozone's debt crisis erupted in late 2009, is the currency area's most heavily-indebted country, despite a big "haircut" this year on privately-held bonds. Its economy has shrunk by nearly 25% in five years.
Negotiations had been stalled over how Greece's debt, forecast to peak at 190-200% of GDP in the coming two years, could be cut to a more sustainable 120% by 2020.
The agreed figure fell slightly short of that goal, and the IMF was still insisting that eurozone ministers should make a firm commitment to further steps to reduce the debt stock if Athens implements its adjustment programme faithfully.
The key question remains whether Greek debt can become sustainable without eurozone governments having to write off some of the loans they have made to Athens.
Germany and its northern European allies have hitherto rejected any idea of forgiving official loans to Athens, but EU officials believe that line may soften after next year's German general election.
Debt relief 'not on the table'
Schäuble told reporters earlier that debt forgiveness was legally impossible, not just for Germany but for other eurozone countries, if it was linked to a new guarantee of loans.
"You cannot guarantee something if you're cutting debt at the same time," he said. That did not preclude possible debt relief at a later stage if Greece completed its adjustment programme and no longer needed new loans.
At Germany's insistence, earmarked revenue and aid payments will go into a strengthened "segregated account" to ensure that Greece services its debts.
A source familiar with IMF thinking said a loan write-off once Greece has fulfilled its adjustment programme would be the simplest way to make its debt viable, but other methods such as forgoing interest payments, or lending at below-market rates and extending maturities could all help.
The German banking association (BDB) said a fresh "haircut" or forced reduction in the value of Greek sovereign debt, must only happen as a last resort.
The ministers agreed to reduce interest on already extended bilateral loans from the current 150 basis points above financing costs to 50 bps.
No figures were announced for the debt buy-back in an effort to avoid triggering a rise in market prices in anticipation of a buyer. But before the meetings, officials had spoken of a €10 billion buy-back, that would achieve a net reduction of about €20 billion in the debt stock.
German central bank governor Jens Weidmann has suggested that Greece could "earn" a reduction in debt it owes to eurozone governments in a few years if it diligently implements all the agreed reforms. The European Commission backs that view.
An opinion poll published on Monday showed Greece's anti-bailout Syriza party with a four percent lead over the Conservatives who won election in June, adding to uncertainty over the future of reforms.