Eurozone ministers have struck a long-delayed bailout deal with Greece to unlock badly needed rescue cash, but warned Athens would have to wait for debt relief.

After hours of talks in Luxembourg IMF chief Christine Lagarde and the eurozone's 19 finance ministers backed a payout of €8.5bn to avoid Athens defaulting in July and avert another debt crisis.

Payment of the latest tranche of Greece's €86bn bailout, agreed in 2015, has been held up for months by a row over its need for debt relief which has pitted bailout-weary Germany against the International Monetary Fund.

"I am pleased to announce we have achieved an agreement on all elements," Euro group head Jeroen Dijsselbloem told a news conference in Luxembourg. "I think this is a major step forward," he added.

In a breakthrough, Ms Lagarde agreed in Luxembourg that the Washington-based IMF would join Greece's massive bailout, but said any payouts depended on the eurozone coming up with a full debt relief plan.

"Nobody claims that this is the best solution. This is a second-best solution, but it's not a bad solution," said Ms Lagarde, a former French finance minister.

The deal averts a repeat of the summer of 2015 when Greece spectacularly defaulted on an IMF loan, and allows Athens to meet €7bn of debt repayments due in July.

"We feel that after this euro group there is much greater clarity for both the Greek people and the financial markets," Greek Finance Minister Euclid Tsakalotos said after the talks.

"There is now light at the end of the tunnel," he said.

Athens had insisted all week it would veto the deal, bitter that the latest disbursement would come without firm debt relief commitments after it delivered on tough reforms.

As a consolation, in a compromise negotiated by France, Greece won a certain amount of clarity from the eurozone on debt relief, including an agreement to link debt repayments to Greek growth.

Debt relief "will be implemented at the end of the programme, conditional on its successful implementation" in 2018, said Mr Dijsselbloem, who is also Dutch finance minister.

The eurozone will now draw up an "exit strategy" over the next year "to enable Greece to stand on its own feet again", Mr Dijsselbloem said.

He thanked the "Greek people for their intense efforts and resolve" after the government in Athens passed the latest in a series of tough reforms to get the cash.

After three bailouts, Greece's debt currently stands at a staggering 180% of annual output, by far the biggest national debt pile in Europe.