Media playback is unsupported on your device Media caption Donald Tusk: "After 17 hours of negotiations we have reached agreement" 
 
 Eurozone leaders have agreed to offer Greece a third bailout, after marathon talks in Brussels. 
 
 Amid one of the worst crises in the EU's history, the head of the European Commission said the risk of Greece leaving the eurozone had been averted. 
 
 Greek Prime Minister Alexis Tsipras said that after a "tough battle", Greece had secured debt restructuring and a "growth package". 
 
 The bailout is conditional on Greece passing agreed reforms by Wednesday. 
 
 These include measures to streamline pensions, raise tax revenue and liberalise the labour market. 
 
 An EU statement spoke of up to €86bn (£61bn) of financing for Greece over three years. 
 
 Though it included an offer to reschedule Greek debt repayments "if necessary", there was no provision for the reduction in Greek debt - or so-called "haircut" - that the Greek government had sought. 
 
 Bailout deal at a glance 
 
 Follow our live updates 
 
 Greece 'back in serious recession' despite rescue 
 
 Parliaments in several eurozone states also have to approve any new bailout. 
 
 "There will not be a 'Grexit'," said European Commission chief Jean-Claude Juncker, referring to the fear that if there had been no deal, Greece could have crashed out of the euro. 
 
 Mr Tsipras also said he had the "belief and the hope that... the possibility of 'Grexit' is in the past". 
 
 "The deal is difficult but we averted the pursuit to move state assets abroad," he said. "We averted the plan for a financial strangulation and for the collapse of the banking system." 
 
 The Greek PM returned to Athens after the talks and went straight into a meeting with Finance Minister Euclid Tsakalotos and other party officials. 
 
 Mr Tsipras must get several unpopular measures through the Greek parliament in the next two days, including sales tax increases and pension reforms, to continue the third bailout process. 
 
 Image copyright AFP Image caption Greeks had an anxious wait as talks in Brussels dragged on 
 
 Analysis: Gavin Hewitt, BBC News, Athens 
 
 Athens has been offered a third bailout. Bankruptcy - the spectre of a failed state - has been avoided, and Greece will stay inside the euro. But the deal has left many Greeks humiliated. It is not just the ranks of the left that are using the word "surrender". 
 
 Greek Prime Minister Alexis Tsipras will have to rush key measures on pension reforms, tax increases and a debt repayment fund through parliament. It will be a bruising process. Only then will bridging loans be released that will enable Greece to meet a payment to the European Central Bank next Monday. 
 
 As it is, the deal will almost certainly lead to snap elections. Mr Tsipras will reshuffle his cabinet and discard those cabinet ministers who opposed his latest proposal. 
 
 Greek anger at eurozone debt deal 
 
 Harsh deal leaves European vision tainted 
 
 Rifts between Europe's superpowers 
 
 Economic consequences for Greece 
 
 Jeroen Dijsselbloem, the head of the eurozone group of finance ministers, said the agreement included a €50bn Greece-based fund that will privatise or manage Greek assets. Out of that €50bn, €25bn would be used to recapitalise Greek banks, he said. 
 
 Greek banks have been closed for two weeks, with withdrawals at cash machines limited to €60 per day. The economy has been put under increasing strain, with some businesses closing and others struggling to pay suppliers. 
 
 Monday saw the European Central Bank maintain its cap on emergency funds being provided to Greek banks, meaning they will stay shut for now to prevent them running out of funds. 
 
 Media playback is unsupported on your device Media caption There have been mixed views on the streets of Athens to the new agreement 
 
 Media playback is unsupported on your device Media caption Greek reforms - in 60 seconds 
 
 Eurozone finance ministers meeting in Brussels have discussed providing "bridge financing" that would cover Greece's short-term needs, but have made no final decisions. 
 
 "The road will be long, and judging by the negotiations tonight, difficult," German Chancellor Angela Merkel said on Monday morning. 
 
 French President Francois Hollande said the agreement had allowed Europe to "preserve integrity and solidarity". 
 
 "We also had to show that Europe is capable of solving a crisis that has menaced the eurozone for several years," he said. 
 
 Greek debt crisis timeline 
 
 26 June: Greece halts talks with creditors and calls referendum on bailout terms 
 
 Greece halts talks with creditors and calls referendum on bailout terms 28 June: European Central Bank (ECB) limits emergency funding to Greece; Greece imposes capital controls, forcing banks to stay shut 
 
 European Central Bank (ECB) limits emergency funding to Greece; Greece imposes capital controls, forcing banks to stay shut 30 June: Eurozone bailout expires, Greece misses €1.6bn payment to IMF 
 
 Eurozone bailout expires, Greece misses €1.6bn payment to IMF 5 July: Greeks overwhelmingly vote "No" in referendum, rejecting creditors' conditions 
 
 Greeks overwhelmingly vote "No" in referendum, rejecting creditors' conditions 9 July: Greek Prime Minister Alexis Tsipras presents new proposals to creditors, including measures rejected in referendum 
 
 Greek Prime Minister Alexis Tsipras presents new proposals to creditors, including measures rejected in referendum 13 July: Eurozone leaders agree to offer Greece third bailout 
 
 And looking forward... 
 
 15 July: Greek parliament to pass reforms demanded by creditors 
 
 Greek parliament to pass reforms demanded by creditors 16-17 July: Possible votes in eurozone member state parliaments on bailout 
 
 Possible votes in eurozone member state parliaments on bailout 20 July: Greece due to make €3.5bn payment to ECB 
 
 Mr Juncker said: "In this compromise, there are no winners and no losers. 
 
 "I don't think the Greek people have been humiliated, nor that the other Europeans have lost face. It is a typical European arrangement." 
 
 However, many Greeks and others who thought that unduly harsh terms were being imposed on Greece have expressed their widespread anger online using the hashtag #ThisIsACoup. 
 
 Mr Tsipras came to power after his left-wing Syriza party won elections in January on a promise to end austerity. Greece has already received two bailouts totalling €240bn since 2010. 
 
 Europe shares rise on news of deal ||||| Merkel and Hollande will meet for crisis talks and the ECB faces a crucial decision over its funding lifeline after Greece rejected austerity by 61% to 39% 
 
 European leaders were scrambling for a response on Monday after a resounding no from Greek voters in a momentous referendum on austerity which could send the country crashing out of the eurozone. 
 
 
 
 With Europe’s financial markets set to follow Asia’s overnight lead by going sharply into the red, German chancellor Angela Merkel was to meet with French leader Francois Hollande in Paris after Greece overwhelmingly rejected international creditors’ tough bailout terms. 
 
 Greek referendum: Asian markets fall sharply after Greece no vote – live Read more 
 
 The pair spoke by telephone late Sunday, declaring the referendum decision must “be respected” and calling for an emergency eurozone summit which the EU president, Donald Tusk, said would be held on Tuesday. 
 
 A flurry of other meetings will also be held on Monday as European leaders sized up the implications of the vote, a victory for Greece’s radical prime minister, Alexis Tsipras, who insisted it did not mean a “rupture” with Europe. 
 
 With the ramifications still unclear and some analysts putting the chances of Grexit at very high, the European commission head, Jean-Claude Juncker, was to hold a teleconference on Monday morning with European Central Bank chief, Mario Draghi, Tusk and Jeroen Dijsselbloem, head of the eurogroup of finance ministers. 
 
 Meanwhile German and French finance ministers were set for talks beginning in Warsaw at 9am BST, while the euro working group of top treasury officials will meet in Brussels. 
 
 Britain said it would do “whatever is necessary to protect its economic security” and David Cameron would be chairing a meeting on Monday to review its reaction, a government spokesman said. 
 
 “This is a critical moment in the economic crisis in Greece,” a Downing Street spokesman said. “We will continue to do whatever is necessary to protect our economic security at this uncertain time. We have already got contingency plans in place and later this morning the prime minister will chair a further meeting to review those plans in light of yesterday’s result.” 
 
 In Athens, Greece’s controversial finance minister Yanis Varoufakis announced that he was standing down immediately after pressure from the country’s “assorted partners”. 
 
 He said he hoped his decision would make it easier for Tsipras to negotiate a new deal with other European leaders. 
 
 
 
 Earlier on Monday morning, Tsipras met the Greek president, Prokopis Pavlopoulos, and asked him to convene a meeting of Greek political party leaders. “We must move forward immediately with negotiations … a strong national front must be created to seek an immediate solution,” Tspiras told Pavlopoulos after the vote. 
 
 
 
 Tsipras said the creditors – the ECB, the European commission and the International Monetary Fund (IMF) – would now finally have to talk about restructuring Greece’s huge debts. 
 
 “This time, the debt will be on the negotiating table,” he said. 
 
 As the magnitude of the result became clear – the margin was an unexpected 61.3% to 38.7% – thousands of no voters began pouring into Syntagma Square in front of the parliament in Athens to celebrate, waving Greek flags and chanting: “No, no.” 
 
 On Sunday night, speaking before his resignation, Varoufakis said the no vote was a rejection of the “iron cage” of the eurozone. 
 
 “Today’s no is a big yes to democratic Europe. A no to a vision of the eurozone as a boundless iron cage for its people. From tomorrow, Europe, whose heart tonight beats in Greece, starts healing its wounds, our wounds.” 
 
 
 
 The sweeping victory for Tsipras, who challenged the might of Germany, France, Italy and the rest of the eurozone, represented a nightmare for the mainstream elites of the EU. With Greek banks closed, withdrawals limited, capital controls in place and the country rapidly running out of cash, emergency action will be needed almost immediately to avoid a likely banking collapse. 
 
 But it is not clear whether the European Central Bank will maintain a liquidity lifeline to Greece and whether the creditor governments of the eurozone will sanction instant moves to salvage Greece’s crashing financial system. 
 
 
 
 Germany’s vice-chancellor and social democratic leader, Sigmar Gabriel, said Tsipras had burned his bridges with the rest of the eurozone. But the Greek leader believes he has strengthened his negotiating hand. 
 
 
 
 Dijsselbloem, who chairs the eurozone group of finance ministers, said the result was “very regrettable” for the future of Greece. “For recovery of the Greek economy, difficult measures and reforms are inevitable. We will now wait for the initiatives of the Greek authorities,” he said. 
 
 
 
 The Greek vote is a huge blow to EU leaders, particularly Merkel, who has dominated the crisis management through her insistence on fiscal rigour and cuts despite a huge economic slump, soaring unemployment and the immiseration of most of Greek society. 
 
 
 
 “The failure of the euro means the failure of Merkel’s [10-year] chancellorship,” said the cover of the latest issue of Der Spiegel, the German weekly. It depicted her sitting atop a Europe in ruins. 
 
 
 
 Greek referendum result: what happens next? Read more 
 
 On the markets overnight, Japan’s Nikkei stock average was down 2.2% and in Hong Kong the Hang Seng was down more than 3%. 
 
 
 
 In Australia, around $A30bn was wiped off the value of shares as the country’s benchmark ASX200 index fell almost 1.5% at the opening. 
 
 Oil prices also fell sharply on Monday amid worries about poor demand growth amid global oversupply. Brent futures were down over a percentage point at $59.56 per barrel. 
 
 However, the single currency held up against the dollar, after dropping in the immediate wake of the vote. It was at $1.1044 in Tokyo trade, ticking up from $1.0963 soon after early results of the bailout reforms vote were known. 
 
 Shinya Harui, currency analyst at Nomura Securities in Tokyo, said the common currency was holding up as investors “assess the spill-over risks in case of a Greek exit from the eurozone”, adding: “I personally think the chance (of the Greek exit) is very high, at around 70-80%.” 
 
 
 
 In Athens the mood was jubilant. “Spain, and then Portugal, should follow this path. We’re for a Europe of the people,” said one no supporter, Giorgos, 25, brushing off concerns the result could see the debt-laden country plunge further into the financial mire. 
 
 But the mood of jubilation was not shared by all no voters, with some saying they had been confronted with an impossible choice. 
 
 But even “yes voters were ambivalent about their camp’s apparent defeat. 
 
 Paris, a 41-year-old dentist, said she was resigned rather than sad because, with the dire state of Greece’s finances and Tsipras in power, there was “no real hope either way”. 
 
 Greece’s conservative opposition chief, Antonis Samaras, announced his resignation as the early results of the referendum became clear on Sunday. His New Democracy party had campaigned for a yes result in the referendum. 
 
 Greece is teetering on the brink of financial collapse. If it does not receive cash and loans soon from European institutions, it could still be forced to resort to government IOUs or a return to the drachma to keep its economy running. 
 
 Last Tuesday, the country defaulted on a €1.6bn (£1.1bn) repayment to the IMF, becoming the first developed country to fall into arrears to the institution. As a result, it is cut off from further IMF financing until it settles the amount. 
 
 The same day, the last bailout for Greece ran out, despite Tsipras’s appeals for it to be extended until the referendum was over. 
 
 Greece was officially declared in default on Friday by the European Financial Stability Facility, which holds €144.6bn of Greek loans. 
 
 Greek banks are now reportedly almost illiquid after a run by panicked customers in the runup to the referendum, which Tsipras abruptly called on 27 June to break an impasse with the creditors. 
 
 A week-long closure of the banks and capital controls that included restricting daily ATM withdrawals to just €60 and blocking money transfers abroad slowed the outflow. 
 
 But if the ECB does not inject emergency euros into Greece’s banks in the next one or two days, more businesses will go belly up and ordinary Greeks will suffer. 
 
 Government spokesman Gabriel Sakellaridis said late on Sunday that the Bank of Greece was asking for the ECB to provide money under its Emergency Liquidity Assistance mechanism. ||||| FRANKFURT A Greek exit from the euro zone could expose the European Central Bank and the currency bloc it seeks to protect to hundreds of billions of euros in losses, landing Germany and its partners with a crippling bill. 
 
 A Greek departure would take Europe into uncharted legal waters. The size of the burden other euro zone states could bear gives them a powerful incentive to keep Greece in the currency club. 
 
 With most of Greek's private creditors having taken heavy writedowns as part of the country's second, 130 billion euros bailout, it is estimated that the ECB, International Monetary Fund and euro zone nations hold approaching 200 billion of its debt. 
 
 "In the event of an exit, they (Greece) will default. And the loss given default will probably be very high, high enough to eliminate the ECB's capital," said Andrew Bosomworth, senior portfolio manager at asset manager Pimco. 
 
 "They might need recapitalization from governments, who are not exactly in the best position to provide additional capital." 
 
 Those are not the only losses the ECB and its national shareholders might face as is explained in detail below. 
 
 Even once Greece had left the currency club, the costs to the rest of the euro zone would continue to mount as it would probably be compelled to avert a complete Greek collapse and wider contagion. 
 
 "Large-scale ECB intervention would be necessary to stabilize the system, along with intervention from Germany, the European Stability Mechanism (ESM), its predecessor the European Financial Stability Facility (EFSF) and the IMF, potentially costing hundreds of billions of euros," said Georgios Tsapouris, investment strategist at Coutts. 
 
 The ECB, which has its own paid-in capital of 6.4 billion euros, is essentially a joint venture between the 17 euro zone national central banks (NCBs). Combined, the Eurosystem of euro zone central banks has capital and reserves of 86 billion euros. 
 
 The national central banks would divide up any losses between them according to the 'capital key' - the ECB's measure of countries' stakes in its financing based on economic size and population. Germany would bear the biggest loss, some 27 percent of the total. 
 
 France would take a big hit too. 
 
 A Greek exit from the euro zone could cost the French taxpayer up to 66.4 billion euros and saddle the country's banking system with 20 billion euros in lost loans, according to a study published on Tuesday by the IESEG School of Management in Lille. 
 
 Smaller countries with less robust national central banks than the German Bundesbank would likely be still harder hit in relative terms. 
 
 "The ECB and some of the NCBs with little loss-absorbing capital and reserves relative to their share of how a loss would be allocated across the Eurosystem would potentially see their capital and revaluation reserves written off," Bosomworth said. 
 
 However, with fresh Greek elections called for June 17 and an anti-bailout leftist party ahead in the polls, some within the EU's corridors of power wonder whether the show is worth keeping on the road. 
 
 "It's going to hurt, absolutely. But is it going to be lethal?" one EU diplomat said. "We have two bad choices, but one is worse than the other." 
 
 TRIPLE WHAMMY 
 
 The ECB and national central banks are exposed to Greece in three main ways: via Greek sovereign bonds the ECB holds, via Greek collateral they hold in return for ECB loans and via Greece's liabilities for transactions over the euro zone's TARGET2 payments system. 
 
 The ECB has spent about 38 billion euros on Greek government debt with a face value of about 50 billion euros. 
 
 Under a scenario described in German weekly Der Spiegel, the euro zone's EFSF bailout fund could be used in the event of a Greek default to continue funding Greece's debt obligations to the ECB. 
 
 However, this would eat into the resources of the 'firewall', eroding its capacity to help other euro zone states which might well need to be protected if a Greek exit sparked contagion. 
 
 An alternative scenario could see the national central banks turning to their governments to recapitalize the ECB. But going cap in hand to politicians for money they are desperately short of risks undermining the ECB's independence. 
 
 ECB loans to Greek banks are another way the central bank is exposed but in this case, although the ECB conducts these medium- and long-term lending operations (MROs and LTROs), the funds are distributed via the national central banks and carried on their balance sheets. 
 
 A Bank of Greece financial statement on its website showed that as of January 31 it had lent out some 15 billion euros in MROs and 58 billion euros in LTROs - a total of 73 billion. 
 
 It was holding 143 billion euros in assets eligible as collateral for euro zone monetary policy operations. 
 
 Berenberg Bank economist Christian Schulz said that in the event of a Greek exit these loans and most of the collateral may be converted into a new Greek currency. 
 
 "The ECB/Eurosystem would not bear the risk anymore," he added, noting that the Bank of Greece would instead be left with the - likely devalued - loans and collateral. 
 
 TARGET RISK 
 
 But any funds Greek banks had taken using ECB loan operations that had subsequently found their way out of Greece could pose a problem. These would be added to the Bank of Greece's liabilities under the TARGET2 payments system. 
 
 The Bank of Greece and other peripheral euro zone countries have built up liabilities within the euro zone's cross-border payment system, TARGET2, due to a net outflow of payments to other countries in the bloc, a trend exacerbated by the debt crisis. 
 
 The Bank of Greece's financial statement showed that as of January it was carrying TARGET2 liabilities of 107 billion euros - a sum that has likely remained around that level since and which represents a big potential problem for the other euro zone central banks. 
 
 "TARGET2 is the biggest risk if they really take that loss," said Schulz, adding that a Bank of Greece collapse would leave central banks remaining in the euro zone with a loss. 
 
 "But it's far from clear whether the full TARGET2 balance would be what Europe would lose," he added. 
 
 The ECB could monetize any net TARGET2 loss in the event of a Greek euro exit by printing money but that would come with an inflationary effect unpalatable to policymakers in Germany, the bloc's most powerful player. 
 
 Beyond the accounting implications for euro zone central banks is the systemic impact a Greek euro exit would have on the bloc's banking system. Savers in other periphery countries are likely to take flight. 
 
 "If they see that Greek savers have seen their euro savings overnight being converted into drachma, which could depreciate by 50-70 percent, then it would be a fairly simple hedge strategy for them to take out some of their savings and put them into Luxembourg, or pounds sterling, or Swiss francs," said Bosomworth. 
 
 Ultimately, Greece will decide whether it leaves the euro zone but the ECB can try to head off such a scenario. 
 
 ECB President Mario Draghi said on Wednesday that "our strong preference is that Greece will continue to stay in the euro zone". 
 
 "What they can do is try to prevent contagion - where they have a very significant role - and they will probably also try to convince participants on all sides to keep Greece in the euro area," said Citigroup economist Juergen Michels. 
 
 (Additional reporting by Sinead Cruise, writing by Paul Carrel, editing by Mike Peacock and Janet McBride)
– Europe has hundreds of billions of reasons to try to keep Greece from unceremoniously ditching the eurozone. If Greece leaves, the rest of Europe would face catastrophic losses, Reuters reports. Greece would default on the roughly $250 billion in debt held by the ECB, IMF, and other eurozone nations, and that loss will likely be "high enough to eliminate the ECB's capital," one investor said. And the losses wouldn't end there because Europe would still probably have to prevent a total collapse or risk economic contagion. How bad could it get? One Guardian estimate puts the total cost at $1 trillion. But it's looking increasingly unlikely Greece will abide by its bailout deal; new elections are looming, and polls favor Alexis Tsipras' far-left party. In a BBC interview, Tsipras urged Europe, and particularly Angela Merkel, to "stop playing poker with the lives of people" by demanding such harsh austerity measures. That defiance has some European decision-makers pushing to rip the Band-Aid off and boot Greece. "It's going to hurt, absolutely," one diplomat tells Reuters. "But is it going to be lethal?"