European Union leaders ended an emergency summit on the region's debt crisis with a sweeping deal that will grant Greece a massive new bailout — but likely make it the first euro zone country to default — and radically reshape the currency union's rescue fund.

The changes agreed to Thursday allow the EU to act pre-emptively when crises build up.

The euro zone countries and the International Monetary Fund will give Greece a second bailout worth $153 billion Cdn., on top of the $154 billion already granted a year ago.

Banks and other private investors will contribute some $70 billion to the rescue package by either rolling over Greek bonds that they hold, swapping them for new ones with lower interest rates or selling the bonds back to Greece at a low price.

"For the first time since the beginning of this crisis, we can say that the politics and the markets are coming together," said European Commission President Jose Manuel Barroso.

Currency markets were encouraging, bidding the euro, which had rallied sharply on expectation of the deal, up further to gain 0.7 per cent to $1.4435 against the US dollar by late afternoon ET.

The euro zone will back up any new Greek bonds issued to the banks with guarantees if the deal is seen as a "selective default" by rating agencies, which is widely expected.

If the agencies make true on their warnings, Greece will become the first euro country to ever be in default — if likely only for a short period of time.

That agreement means Greek banks will be able to continue accessing cash from the European Central Bank. Without that support, Greek banks would quickly collapse.

Greece's economy has continued to struggle and it has been unable to raise money on international markets.

Bailout fund overhauled

The leaders also overhauled their bailout fund, giving it the power to intervene in countries before they are in full-blows crisis mode.

The changes are a big turnaround, especially for Germany, which had blocked any such move this year. They show how worried the euro zone is that its debt crisis could spill over from small countries like Greece, Ireland and Portugal to big ones like Spain or Italy. Full bailouts for those countries would likely overwhelm the euro zone's financial capacity.

To avoid that they will ever be in that position, the deal provides for a "precautionary program," such as short-term credit lines, for struggling countries.

Such credit lines could be very helpful for Italy and Spain if they ever experience a funding squeeze, showing investors that support is available if things get tight.

They could also make it easier for Ireland and Portugal to start raising money again on financial markets once their own rescue programs run out.

Few economists believed that even with more support, Greece would have been able to repay its debt — some $476 billion — without some kind of cut to the overall value.

Markets have been extremely volatile over the past weeks on fears the crisis might spread to larger countries like Italy. Borrowing rates have risen particularly sharply in Italy and Spain.

The International Monetary Fund had warned that leaders must do more to keep debt troubles from poisoning the entire continent's economy.

Rating agencies have warned for weeks that any form of private sector involvement in a bailout, even if voluntary and without a haircut, would be seen as a "selective default" — a rating that has never been held by a country while in the euro zone.

A selective default rating implies that terms of a bond, such as the repayment deadline or interest rate, have been altered. It falls short of an outright "default" rating, which is usually triggered when the borrowing country or company doesn't pay back the whole amount it owes.

With files from The Associated Press