Eurozone states have agreed on a plan that they say will allow Greece to exit its eight-year bailout program and make its massive debts more manageable.

The finance ministers of the 19 EU countries reached the compromise after a day of marathon talks in Luxembourg early on June 22.

The ministers were under pressure to finalize a deal that would allow Greece to safely emerge from the bailout program on August 20 and face the markets again.

"The Greek crisis ends here tonight," said EU Economic Affairs Commissioner Pierre Moscovici. "We finally got to the end of this path which was so long and difficult. It is a historic moment."

Under the deal, Greece can delay repayment on billions in loans for another 10 years, giving it a financial breather. It also got another injection of another 15 billion euros ($17.5 billion).

Greece has already received 275 billion euros ($320 billion) in financial support from the EU over the past eight years.

"It took a bit longer than we expected, but ended in a very good way," Greek Finance Minister Euclid Tsakalotos said. "I think it is the end of the Greek crisis...a historic moment."

Based on reporting by AP, dpa, and AFP