Greece has agreed to harsh terms for a new three-year bailout package with international creditors, Greek and European Union officials said, with a few remaining details to be ironed out.

A swift deal on the €85 billion in new loans would prevent the country from defaulting on its debts next week and secure its future in the euro.

"We are very close. Two or three very small details remain," Greek finance minister Euclid Tsakalotos said as he emerged from all-night discussions with creditors.

The European Commission, a key negotiator in the talks, confirmed the progress.

"The institutions and the Greek authorities achieved an agreement in-principle on a technical basis and talks are still ongoing on finalising details," said Annika Breidthardt, the Commission's spokeswoman for economic affairs.

The draft deal forces left-wing Prime Minister Alexis Tsipras to accept what he had vowed to resist only months ago: the sale of some state property and deep cuts to pensions, military spending and tax credits to people considered vulnerable.

Dissenters in Mr Tsipras' Syriza party, who want to end bailout talks and return to a national currency, promised to fight the deal, describing it as a "noose around the neck of the Greek people".

The government is hoping to push the agreement through parliament this week - something that will require the continued support of opposition parties - ahead of a meeting between eurozone finance ministers on Friday.

The agreement still requires approval from higher-level representatives, and senior finance officials from the 28 EU nations are due to hold a conference call.

Germany, the largest single contributor to Greece's two previous bailouts and among the toughest negotiators so far, remained cautious on the timing for a final deal. "We will have to examine the results that come in the course of today," deputy finance minister Jens Spahn said.

Investors cheered the news of progress.

Greece's government borrowing rates fell, a sign investors are less worried about a default. The two-year bond yield dropped by 4.2 percentage points to 14.73 per cent. The Athens Stock Exchange, which reopened recently after being shut for five weeks during the most severe part of Greece's financial crisis closed up 2.1 per cent.

Cash-strapped Greece needs more money by August 20 at the latest, when it has a debt repayment of just over €3 billion to make to the European Central Bank.

The government insisted it has also gained key concessions from lenders: greater control over labour reforms, avoiding a "fire sale" of state assets, and softer deficit targets.

It said it had agreed to have a 0.25 per cent government deficit this year and a 0.5 per cent surplus next year, when not counting the cost of servicing debt. Those so-called primary surpluses would rise to 1.75 per cent in 2017 and 3.5 per cent in 2018.

The surpluses are more ambitious than those of many European countries - Spain, for example, is not expected to achieve a primary surplus before 2018. That is largely because the creditors want to make sure Greece is able to start paying off its debt load as soon as possible.

The government claims the creditors wanted even more ambitious surplus targets, and that the targets it agreed to mean it has will be able to spare the country budget cuts worth about €20 billion.

"This practically means that with the current agreement there will be no fiscal burden - in other words new measures - in the immediate future," the government said.

Banks will be strengthened with new cash infusions by the end of the year and will have an immediate boost of "at least €10 billion", it said. The government insists this means there is no longer any danger that the banks may have to raid bank deposits to restore their financial health.

The government also said that banks will not make repossessions and auctions of primary residences will not occur within 2015.

Greece has relied on bailouts worth a total €240 billion from eurozone members states and the International Monetary Fund since concern over its high debts locked it out of bond markets in 2010. To secure the loans, successive governments have had to implement spending cuts, tax hikes and reforms.

While the austerity has reduced budget overspending, the measures compounded a deep recession and pushed unemployment to a record high. Figures next week are expected to confirm that Greece's recession deepened in the second quarter.

Mr Tsipras later called for an emergency session of parliament to vote on new bailout deal on Thursday.

He requested an end to the summer recess to allow for the two-day procedure.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.