Eurozone finance ministers have agreed to a third bailout program for crisis-stricken Greece. The country will receive €86 billion over three years, with the first tranche expected next week.

“New loans of up to €86 billion will be made available over the next three years to Greece,” the Commission said in a statement.

The International Monetary Fund (IMF) will consider joining the program in October, depending on the results of Greek pension reform.

Recapitalization of Greek banks is also scheduled for autumn, eurogroup President Jeroen Dijsselbloem said, announcing the results of the meeting. He assured that bank deposits will be secured, including from any bail-in.

“The message of today’s Eurogroup is loud and clear: on this basis, Greece is and will irreversibly remain a member of the Euro area,” Jean-Claude Juncker, European Commission president, said in a statement.

The Commission’s vice-president for the Euro and Social Dialogue, Valdis Dombrovskis, added that Friday’s agreement “will lift the uncertainty that has hung over the country and the euro area for too long... We are ready to support Greece with all our instruments – from technical assistance to financial support.”

In accordance with the agreement, Greece must achieve a medium-term budget surplus of 3.5% of GDP in 2018. The eurogroup obligated Athens to move from a deficit of 0.25% this year to a surplus of 0.5% in 2016, and 1.75% in 2017, in order to reach the target level in 2018.

The eurozone hopes the aims can be achieved via large-scale reforms of the pension scheme and the labor market. It is also hoped that changes to the tax system will increase tax revenues.

The six hour meeting was preceded by the endorsement of the loan conditions by the Greek parliament.

The deal, which includes tax rises and spending cuts in exchange for free loans, was met with much opposition within the Greek parliament. Key ruling Syriza party members, including former Finance Minister Yanis Varoufakis, voted against the bill, while some of his allies abstained.

The German Bundestag could vote on the Greek bailout as soon as Tuesday, following the eurozone’s approval. However, Bild newspaper reported this week that Chancellor Angela Merkel’s government considers the agreement insufficient.

Greece is due to make a €3.2 billion repayment to the European Central Bank on August 20.