Eurozone ministers agreed to extend maturities by 10 years on major parts of Greece's total debt obligations while the country secured a 15 billion euros ($17.5 billion) loan for a smooth bailout exit in August.
Eurozone ministers agreed debt relief and a big cash payout for Greece early on Friday, part of a broad exit deal that will close eight years of austerity and bailouts for Athens.
"We have a deal on Greece," a European source said confirmed by other official sources, after more than six hours of talks dominated by last minute resistance by Germany.
Greece is slated to leave its financial rescue on August 20 and finance ministers from the 19 countries that use the single currency were under pressure to offer Athens a goodbye deal that left it strong in the eyes of the financial markets.
With writing-off loans off the table, eurozone ministers agreed to extend maturities by 10 years on major parts of its total debt obligations, a mountain that has reached 180 percent of GDP -- almost double the country's annual economic output.
Sources also said the creditors would disburse 15 billion euros ($17.5 billion) to ease the country’s exit from its program.
The agreement is an important turning point for the eurozone nearly a decade after Greece stunned the world with out-of-control spending and sparked three bailouts and a near collapse of the euro single currency.
The deal was expected to be an easy one, but last-minute resistance by Germany -- Greece's biggest creditor -- on debt relief dragged the talks on for six hours.
Greece's latest 86-billion-euro programme was agreed in 2015 after six contentious months of negotiation, bringing the level of assistance received by Athens to 273.7 billion euros since 2010.
The rescue loans came in return for hundreds of stringent reforms that landed like a rock on a Greek economy, which shrank by nearly 25 percent in just a few years and sent unemployment surging.
Greece however will remain under the watch of its creditors after the bailout and under stricter terms than for Portugal, Ireland and Cyprus following their respective bailouts.
Under German demands, Greece's debt relief in the short-term will be conditional on the continued implementation of agreed reforms, which if successful could inject about one billion euros to the government's underfunded budget every year.
"We will ensure that the pressure to implement further reforms remains strong... in the medium and long term," said Austrian Finance Minister Hartwig Loger.