LUXEMBOURG (Reuters) - Euro zone finance ministers on Friday extended maturities and deferred interest of a major part of their loans to Greece along with a big cash injection to ensure Athens can stand on its own feet after it exits its bailout in August.

Greece has been living primarily on money borrowed from euro zone governments in three bailouts since 2010, when it lost market access because of a ballooning budget deficit, huge public debt and an inefficient economy and welfare system.

With hundreds of reforms requested by its creditors already completed, Greece has made significant progress, but to lend to it again, investors need to know it will not collapse under the weight of servicing a debt of 180 percent of GDP.

“After eight long years, Greece will finally be graduating from its financial assistance,” the chairman of euro zone finance ministers Mario Centeno told a news conference in the small hours of Friday after hours of negotiations of the deal.

“Further debt relief was needed to make Greek debt sustainable in the future,” he said.

Finance Ministers Euclid Tsakalotos told reporters the deal made Greek debt viable again and paved the way for a return to market financing.

“The Greek government is happy with this deal,” he said.

The key element of the debt relief is an extension of maturities and grace periods on 96.9 billion euros of loans granted to Greece under the second bailout by 10 years to smooth out any sharp debt servicing peaks for decades ahead.

Greece will also get a 15 billion euro new loan, which will take the total cash buffer with which it will leave the bailout on Aug 20 to 24.1 billion. This will give it independence form market borrowing for some 22 months, euro zone ministers said in a statement.

A Greek flag flutters atop the parliament building in Athens, Greece, June 21, 2018. REUTERS/Costas Baltas

Athens faces bond repayments of around 7 percent of its output next year, the first after its third bailout ends in August. For more details of Greece's outstanding debt, click tmsnrt.rs/2JYhBYS.

The extension of maturities and deferral of interest and amortization payments are to reassure investors that Greece can handle servicing its debt long into the future -- a confidence booster needed all the more amid growing market concerns over looming trade wars and rising eurosceptism.

“The problem of the Greek debt is behind us now,” France’s Finance Minister Bruno Le Maire told reporters.

To provide an incentive for future governments in Athens not to reverse the hard won reforms implemented under the bailouts, euro zone ministers agreed to offer Greece cash payments of 600 million euros every six months until 2022 if the country sticks to the economic course agreed with creditors.

The money will come from profits made by euro zone central banks on their holdings of Greek bonds that will gradually mature over the next four years.

The International Monetary Fund welcomed the deal saying it would improve Greek debt sustainability in the medium term.

But IMF Managing Director Christine Lagarde said the Fund maintained some reservations about it in the very long term, when assessed until 2060 and therefore welcomed the readiness of the euro zone to do more if an adverse economic scenario were to materialize over the coming decades.

European Central Bank President Mario Draghi also noted the deal improved Greek debt sustainability over the medium-term and welcomed the option of further relief should it be needed.

Unlike the first two Greek bailouts, the IMF did not join the latest Greek program with it its own loans, but will continue to monitor Greece’s performance alongside the euro zone.