Eurozone finance ministers have agreed a second bailout for Greece after marathon talks in Brussels.
Greece is to receive loans worth more than 130bn euros (£110bn; $170bn).
In return, Greece will undertake to slash its debt from 160% to 120.5% of GDP within eight years and accept a permanent EU economic monitoring mission.
The country needs the funds to avoid bankruptcy on 20 March, when maturing loans must be repaid.
The euro immediately rose on reports of the deal, which was announced early on Tuesday, after 13 hours of talks.
But a report by international experts obtained by Reuters news agency warned Greece would need more help if it was to meet its debt reduction target.
The confidential report was drawn up for the international "troika" set up to help Greece - drawn from the IMF, European Central Bank and European Commission.
It warned Greece would remain "accident-prone" in coming years.
Under the deal hammered out in Brussels
- Greece will undertake to reduce its debt to 120.5% of GDP by 2020
- Private holders of Greek debt will take losses of 53.5% on the value of their bonds, with the real loss as much as 70%
- Greece's economic management will be subjected to permanent monitoring by eurozone experts on the ground
- Greece will amend its constitution to give priority to debt repayments over the funding of government services
- Greece will set up a special account, managed separately from its main budget, that must always contain enough money to service its debts for the coming three months
The Greek parliament is expected to vote on the bailout on Wednesday.
The agreement was announced early on Tuesday by Jean-Claude Juncker, prime minister of Luxembourg and chairman of the eurozone finance ministers group.
Mr Juncker said the "far-reaching" deal would lead to "a very significant debt reduction for Greece" and ensure its future within the eurozone.
He said the Eurogroup was "fully aware of the significant efforts already made by the Greek citizens".
In a statement, the Eurogroup said the new "comprehensive blueprint... hinges critically on its thorough implementation by Greece".
The head of the IMF, Christine Lagarde, who also took part in the negotiations, said the deal "should give enough space for Greece to restore its competitiveness".
Speaking after the bailout was agreed, Greek Prime Minister Lucas Papademos said he was "very happy" with the outcome.
"It's no exaggeration to say that today is a historic day for the Greek economy,'' he added.
The BBC's Stephen Evans in Brussels says the agreement will mean deeper cuts in public spending than Greece has planned.
A first rescue package worth 110bn euros in 2010 was not enough to avert Greece's deepening crisis.
"The funds that are coming in are not staying in Greece, are not being invested in Greece, are not here to help the Greeks get out of this crisis," Constantine Michalos, president of the Athens Chamber of Commerce and Industry, told the BBC.
"It's simply to repay the banks, so that they can retain their balance sheets on the profit side."
Anastasis Chrisopoulos, a 31-year-old Athens taxi driver, saw no reason to cheer the bailout.
"So what?" he told Reuters.
"Things will only get worse. We have reached a point where we're trying to figure out how to survive just the next day, let alone the next 10 days, the next month, the next year."
German and Dutch legislators are also scheduled to vote on approval for the deal next week. Politicians in both countries have been critical of lending more money to Greece.
Successive rounds of austerity measures, demanded by Greece's international creditors, have failed to restore growth and have provoked clashes between protesters and police.
The Greek government fell last year after ex-Prime Minister George Papandreou called for a referendum on the eurozone rescue package.
He was replaced by Mr Papademos, an unelected technocrat who is expected to lead Greece until parliamentary elections in April.
Measures passed by parliament last week set out 3.3bn euros' worth of cuts to salaries and pensions, and to health and defence spending - sparking a fresh series of protests.