After months of acrimony, Greece clinched a bailout agreement with its European creditors on Monday that will, if implemented, secure the country's place in the euro and avoid financial collapse.

The terms of the deal, however, will be painful both for Greeks and their left-led government, which since its election in January had vowed to stand up to the creditors and reject the budget cuts they have been demanding.

Before it can get 85 billion euros ($120.5 billion Cdn) in bailout cash and support for its banks to reopen, the Greek government will have to pass a raft of austerity measures that include sales tax increases, reforms to pensions, and labour market reforms.

Greece will be on a tight timetable to implement its reforms — a reflection of how little its creditors trust the government to honour a deal. Greek Prime Minister Alexis Tsipras infuriated his European partners last month when he called for a popular vote against economic reforms the creditors proposed.

The Greek people voted against those proposals, but now face even tougher measures. Syriza's Left Platform, a group of traditionalists in Tsipras's own party, swiftly denounced the agreement as the "worst deal possible ... that maintains the country's status: a debt colony under a German-run European Union."

Both sides in Brussels acknowledged the bitterness that marked their negotiations and kept them negotiating nine hours past a Sunday midnight deadline.

"Trust needs to be rebuilt," said German Chancellor Angela Merkel, adding that with the deal, "Greece has a chance to return to the path of growth."

Next steps for Greece

In a first step toward getting its bailout loans, the Greek government has to pass a set of measures into law by Wednesday.

They include an increase in the sales tax and reform of the pension system. In later weeks, Greece will have to open to competition industries that have long been protected, such as the energy sector. Labour laws will be made more flexible.

A vote to pass those measures, however, isn't guaranteed. A junior coalition partner in the Greek government has already said it won't back the agreement with Greece's European creditors.

"The prime minister of this country was faced with a coup staged by Germany and other countries," said Panos Kammenos, leader of the Independent Greeks party, after meeting with Prime Minister Alexis Tsipras. "This deal introduced many new issues... we cannot agree with it." 

What the deal would mean for Greece

If it meets the creditors' requirements, Greece will get a three-year rescue program and a commitment to restructure its debt, which is unsustainably high at around 320 billion euros ($453.7 billion Cdn), or around 180 per cent of annual GDP.

Tsipras argues that because of these concessions Monday's deal is, despite the tough austerity, actually better for Greece than the proposals Greeks voted down just a week ago.

"We managed to avoid the most extreme measures," Tsipras said. "Greece will fight to return to growth and to reclaim its lost sovereignty."

He said he had managed to avoid a demand by some creditors to transfer Greek assets abroad as a form of collateral and to avoid the collapse of the banking sector.

EUROZONE-GREECE/

Under a new deal, the Greek government will be given another bailout if it passes a series of austerity measures demanded by European creditors. (Christian Hartmann/Reuters)

Banks remain closed

Greece's banks, which have been shut for two weeks, were still closed on Monday and limits remained on cash withdrawals. Without a deal, they faced the prospect of collapse within days as they are steadily drained of money.

When the banks will be able to reopen will depend on whether the European Central Bank decides to increase emergency credit to Greek banks now that a bailout deal with Greece has been clinched in principle. It was unclear whether the ECB would make such a decision on Monday or after Greece passes its first batch of reforms.

French President Francois Hollande said the Greek parliament would convene within hours to adopt the reforms called for in the plan and he celebrated Greece's continued membership in the euro.

Losing Greece, he said, would have been akin to losing "the heart of our civilization."

Other European officials were less emotive.

"The Greeks have to show they're credible, show that they mean it," said Jeroen Dijsselbloem, president of the eurogroup of eurozone finance ministers and a longtime critic of the Tsipras government.

Debt repayment looming

The creditors said they would help Greece in the short term deal with its debt repayments since any bailout agreement was not imminent. Greece will need help making a 4.2 billion euro debt repayment on July 20. It is also in arrears on about 1.5 billion euros owed to the International Monetary Fund since June 30.

If the talks had failed, Greece could have faced bankruptcy and a possible exit from the euro, the European single currency that the country has been a part of since 2002. No country has ever left the joint currency, which launched in 1999, and there is no mechanism in place for one to do so.

Greece had requested a three-year, 53.5 billion euro ($75.9 billion Cdn) financial package, but that number grew larger by tens of billions as the negotiations dragged on and the leaders calculated how much Greece will need to stay solvent.

Greece has received two previous bailouts since 2010, totalling 240 billion euros ($340.3 billion Cdn), in return for deep spending cuts, tax increases and reforms from successive governments. Although the country's annual budget deficit has come down dramatically, Greece's debt burden has increased as its economy has shrunk by a quarter.

With files from Reuters