Greece agreed to cut spending and wages, and to permit outsiders to supervise its finances through European Union and IMF officials stationed in Greece. The rescuers also demanded a separate account for the aid money and legal guarantees that creditors get paid before teachers, doctors and police do.
The agreement assumes that banks and investors owed money by Greece will take new bonds that reduce their holdings by more than half.
Even if it later balks at the bailout conditions, Greece would have difficulty writing down the new debt it issued to private bondholders, who demanded stronger legal protections. Official creditors — the IMF, the eurozone countries and the European Central Bank — would also have difficulty accepting more writedowns.
Inability to pay — or unwillingness to accept the harsh conditions — could lead to a non-negotiated "hard" default that could end in Greece leaving the euro.
On top of the new rescue loans, Athens will also ask banks and other investment funds to forgive it some euro107 billion ($142 billion) in debt, while the European Central Bank and national central banks in the eurozone will forgo profits on their holdings.
The deal "closes the door to an uncontrolled default that would be chaos for Greece and Greek people," said European Commission President Jose Manuel Barroso.
Despite those unprecedented efforts, Greece is at the very best starting on a long and painful road to recovery.
It is being pushed to make its economy more business-friendly and productive by opening access to closed trades and professions; halting rampant tax evasion; allowing more flexibility in wage bargaining between companies and unions; simplifying starting a business; and cutting its bureaucracy.
"It's not an easy (program), it's an ambitious one," said Christine Lagarde, the head of the IMF.
For the private debtholders who Greece owes money to, the bond swap will lop euro107 billion off Greece's euro352 billion load. On top of that, investors will be asked to give Athens 30 years to repay them, compared with just under 7 years.
Average interest rates would fall to 3.65 percent from around 4.8 percent.
Overall losses for private bondholders would be above 70 percent when accounting for the new bonds' longer repayment period and lower interest rate.
Private investors weren't the only ones having to give ground. The eurozone countries will reduce the interest that Greece has to pay for its first package of bailout loans to 1.5 percentage points over market rates from between 2 percentage points to 3 percentage points currently.
At the same time, the European Central Bank and the national central banks in the countries that use the euro will forgo profits on their Greek debt holdings, again reducing the costs for Greece.
Several hurdles remain before Greece will see any of the money or other benefits of the new program.
Apart from the implementation of more than 30 different savings and reform measures by Greece, the new bailout has to be debated by parliaments in several member states, including Germany, the Netherlands and Finland.
The IMF also still has to decide how much of the euro130 billion bill it is willing to stump up. The Washington-based fund had indicated its contribution will be lower than the one-third of the total it has provided in previous bailouts.
Lagarde, the IMF chief, said the fund's board would decide on its contribution in mid-March. It will consider the whole program, "but also additional matters such as the proper setting up of a decent firewall," she said.
The overall ceiling for eurozone rescue loans has been set at euro500 billion ($663 billion), much of which has already been committed to Ireland, Portugal and now Greece.
Euro leaders will decide at their summit in early March whether that ceiling should be increased.
It will also take some time to see how many private creditors will participate in the debt relief and how many will have to be forced to sign up through new legal clauses. The representatives of the private bondholders said they were confident that investors would find the deal attractive, but some analysts fear that imposing losses on even some bondholders may destabilize markets.