- Greece will transfer 50 bn euros worth of assets into a fund to be prepared for an eventual privatisation

- There will be a new bailout lasting three years

Eurozone leaders have unanimously agreed on a bailout deal for Greece, says the European Union president.

Donald Tusk announced on Monday that the agreement would pave the way for Greece to remain a member of the euro by conducting "serious reforms and obtaining "financial support".

We managed to avoid the restructuring of the debt. Greece will continue to battle so that we can regain our sovereignty and dignity. This is our legacy Alexis Tsipras, Greek Prime Minister

The deal - if ratified by the parliaments of first Greek and then eurozone countries - would provide much needed cash "to get Greece back on track", according to Jeroen Dijsselbloem, Eurogroup president.

The details of the deal were not immediately available, but Dijsselbloem said the deal included a requirement of re-capitalisation of banks.

He also said a fund wound be set up which would aim to reduce the country's debt and to cover the cost for re-capitalisation of banks.

Shortly after the annoucement, Alexis Tsipras, the Greek prime minister, said that the deal is "the best possible" and that his team managed to avoid "the plan of the financial suffocation".

"We managed to avoid the restructuring of the debt. Greece will continue to battle so that we can regain our sovereignty and dignity. This is our legacy," he said.

Tsipras said that the deal would put "the burden" on those who were avoiding it for years.

Al Jazeera's John Psaropoulos, reporting from Athens, said that the Greek government would have to take tough measures to meet the requirements of the deal, but Tsipras would "put the best possible spin on all of this".

He said the fact that the government would have to sell some of the state property to generate 50bn Euros as part of the deal would face resistance from the Greek people.

"He is going to say: "Look, we've got through the most difficult negotiations that Greece ever had to face so far. And what we've come away with is at least a promise to look at the rescheduling of debt. It was never on the table before, now it is", he said.

Solidarity among member states

Angela Merkel, the German chancellor, said that they would not be any writing down of debt and that the deal would affect pensions and prompt privatisation among other reforms.

"I think we found ways where it's true what I have repeatedly said, that advantages clearly dominate disadvantages," said Merkel.

Ordinary Greeks want economic limbo to end

"The basic principles which we always followed to rescue the euro are there, namely on the one side solidarity among member countries, and on the other side the responsibility of the country where changes need to take place."

She said that the deal was reached despite the recent losss of "the most valuable currency, namely trust in each other".

Tsipras agreed to tough reforms after 17 hours of gruelling negotiations in return for a three-year bailout worth up to 86 billion euros ($96bn), Greece's third rescue programme in five years.

Greece applied last week for a third programme from the eurozone's bailout fund, the European Stability Mechanism, after its previous bailout expired on June 30, leaving it without international financial assistance for the first time in years.

Greek banks have been closed for nearly two weeks and there were fears they were about to run dry due to a lack of extra funding by the European Central Bank, meaning Athens would have had to print its own currency and effectively leave the euro.

Athens had infuriated its creditors with actions including a surprise referendum on July 5 in which Greeks overwhelmingly rejected previous bailout terms offered by its creditors.

The full terms of the new deal were not immediately available but they looked set to be even tougher than those originally offered to Greece, AFP news agency reported.