Leaders of the Eurozone countries have agreed a new bailout package for Greece worth 109bn euros ($155bn, £96.3bn).
For the first time, private lenders, including banks, are also pledging support which will give Greece easier repayment terms.
The deal, struck at an emergency summit of the Eurozone's 17 member countries, also involves support from the International Monetary Fund (IMF).
Banks and other private investors will contribute 37bn euros to the package.
The Greek Prime Minister, George Papandreou, welcomed the deal: "We now have a programme and a package of decisions which create... a sustainable debt management for Greece.
"And this in the end of course will mean not only the funding of a programme but it will also mean the lightening of the burden on the Greek people."
French President Nicolas Sarkozy said private lenders will contribute a total of 135bn euros over 30 years to Greece.
The involvement of commercial lenders in providing assistance to Greece had been one of the thorniest issues under discussion.
France and the European Central Bank (ECB) were against it, fearing it could spark a Europe-wide banking crisis, push Spain and possibly Italy into trouble, and even jeopardise the solvency of the ECB itself.
Germany though insisted on the private sector bearing some of the pain, or, in the jargon "taking a haircut".
One sticking point against roping in non-government lenders was that any move to allow the country easier repayment terms would be viewed by credit rating agencies as a tacit admittance that it was unable to sustain its borrowings - something that would put it into "partial default".
That would limit the ability of certain institutions, including the ECB, to continue to lend Greece money, as its own rules mean it can only accept collateral from borrowers the agencies say have not defaulted on loans.
The ECB chief, Jean-Claude Trichet, declined to "prejudge" whether it would amount to a default.
But the eurozone 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.
The ratings agencies have yet to give their verdicts on the deal, but if they do deem Greece to have defaulted, it will make the country the first in Europe to have done so.
Europe is trying to find ways to circumvent the agencies whose judgements on credit-worthiness dictate the cost of borrowing for countries and companies.
On Thursday, European Commission President Jose Manuel Barroso said: "We... endorsed the plan of reducing overreliance on external credit ratings."
He said policymakers would come forward in the autumn "with further proposals".
Mr Barroso said this second wave was a one-off event, hinting that other countries would not be in line for further help: "We are crystal clear that PSI [private sector involvement] is for Greece and Greece alone. It is an exceptional situation that we exclude for others."
Tonight's announcement should make life easier for Ireland, as well as Greece.
It also included a 2% reduction in the Irish Republic's interest payments, something that the Republic's Prime Minister, Enda Kenny said would save it a "substantial" 600-800m euros a year.
President Sarkozy said there would be no private sector involvement with Ireland or Portugal: "With respect to the two other countries under the programme, Ireland and Portugal, we are going to reduce rates and lengthen the maturities of the loans granted by the European monetary fund but we will exclude any private sector involvement."
But economics Professor Nouriel Roubini, from New York University's Stern School of Business, said although the summit called Greece's debt restructuring an exceptional case "a year from now Portugal and Ireland will need the same debt relief".
Another key element of the package is an expansion of the role of the European bailout mechanism, the European Financial Stability Facility (EFSF) so it can act more freely.
The President of the European Council, Herman Van Rompuy said: "Reform of the EFSF will make it more flexible and effective. We do not now have to wait for substantial damage to occur before we can intervene."
Longer term, President Sarkozy said the group had a plan to form a further support body modelled on the International Monetary Fund: "We have agreed to create the beginnings of a European Monetary Fund."
Financial markets gained on hopes of a new deal with the US Dow Jones index closing up 1.2% after the deal was announced.
Earlier in Europe trading, shares in Milan rose by 4%, and Spanish shares jumped 3%.
European banking shares did well in advance of the announcement.
In Germany, Commerzbank climbed almost 9% and Deutsche Bank rose 3.6%, while in France Societe Generale and Credit Agricole gained about 6%.
German and French banks are the biggest holders of Greek debt.
UK banking shares also rose strongly, with Barclays gaining 7.7%, Lloyds 5.9% and RBS 5.7%.
Greece received its first aid package in May last year, but the debt crisis continues to undermine confidence in global financial markets, with some commentators suggesting it threatens the future of the euro itself.
Athens has already implemented a raft of wide-ranging austerity measures, including spending cuts and tax rises, and earlier this month agreed to further drastic action to cut its debt.