Greece agreed to harsh terms for a new three-year bailout Tuesday and vowed to push it through parliament this week, despite mounting dissent in the ruling left-wing party.
With the country facing the risk of a debt default next week, Prime Minister Alexis Tsipras had sought to speed up the talks and get approval of a deal this week.
After Greece and its creditors reached an accord on the main points on Tuesday, Tsipras called for an emergency session of parliament for a vote late Thursday.
Greece needs to start tapping the new bailout — worth $93 billion — so that it can make a key debt repayment next week and secure its future in the euro.
The draft agreement forces 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 ending tax credits to people considered vulnerable.
Officials in Athens and the European Union said a few issues were left to be ironed out Tuesday.
"We are very close. Two or three very small details remain," Finance Minister Euclid Tsakalotos said as he emerged Tuesday morning from all-night discussions with creditors.
The European Commission, a key negotiator in the talks, confirmed the progress. Annika Breidthardt, the Commission's spokeswoman for economic affairs, said the details were expected to be cleared up later in the day.
Dissenters in Tsipras' left-wing 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."
Tsipras requested an end to the summer recess to allow for the two-day approval procedure and to get a vote before a meeting of eurozone finance ministers on Friday.
The agreement still requires approval from higher-level representatives, and senior finance officials from the 28 EU nations were holding a conference call Tuesday.
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 told n-tv television.
Investors cheered the news of progress.
Greece's government borrowing rates fell, a sign investors are less worried about a default. The 2-year bond yield dropped by 4.2 percentage points to 14.73 percent. 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 percent.
Cash-strapped Greece needs more money by Aug. 20 at the latest, when it has a debt repayment of just over 3 billion euros to make to the European Central Bank.
The government insisted it has also gained key concessions from lenders: greater control over labor reforms, avoiding a "fire sale" of state assets, and softer deficit targets.
It said it had agreed to have a 0.25 percent government deficit this year and a 0.5 percent surplus next year, when not counting the cost of servicing debt. Those so-called primary surpluses would rise to 1.75 percent in 2017 and 3.5 percent 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's 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 euros.
"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 in a note.
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 euros," 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 $263 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.
Though the government was elected on a staunchly anti-austerity platform in January, it has been forced into a policy U-turn after bailout talks came close to collapse last month.
While Greece's parliament ratified further tax hikes and reforms, the rebellion by hardline Syriza lawmakers has left Tsipras' party with only a nominal parliamentary majority.
That has stoked speculation that Tsipras will call early elections after the bailout deal is signed. Tsipras still retains strong personal support in opinion polls, which show Syriza heading for a potentially big victory.