Top Greek political parties on Tuesday were close to forming a coalition government to try to steer the country back to economic health and provide the nation its first elected leadership in more than seven months.

Talks continued on a power-sharing agreement in which Antonis Samaras, who led the center-right New Democracy party to a first-place finish in Sunday’s election, would become prime minister in an alliance with traditional rivals from the Socialist party, or Pasok, and the smaller Democratic Left.

Considered a solid but not unshakable coalition, the three-party alliance would control 179 seats in the 300-member assembly — and support an international rescue package against opposition from the upstart Syriza party and other anti-bailout groups.

Samaras has said that he would try to ease some of the measures required by the plan in return for international loans but that Greece must abide by the basic commitments made to its lenders if it expects to keep its standing in the euro zone.

It is in some ways a startling turn for the New Democracy party, on the verge of coming back to power even though it was the party that governed Greece during boom years in which some of its current problems were allowed to fester.

The three-party coalition is Greece’s “one remaining practical solution” to install a government promptly and try to revive its international bailout program after weeks of political stalemate, said Socialist party leader and former finance minister Evangelos Venizelos. His comments came as bartering continued over control of different ministries and the strategy to pursue with international lenders.

The Socialist party finished third in Sunday’s vote, a humiliating collapse for a once-dominant bloc. Voters blamed the previous Socialist government, led by George Papandreou, for ushering in the austerity program demanded by the bailout plan.

Venizelos, quoted on the Athens News Web site as the latest round of meetings ended, said the coalition was prepared for a “bitter renegotiation.”

The new government will immediately open talks with the International Monetary Fund, the European Central Bank and the European Commission over where the Greek economy stands after weeks in which work on various economic policy changes and budget projects ground to a halt in anticipation of the election. There may be room to slow the timetable of the bailout plan — the IMF actually argued for more gradual deficit cutting when the program was negotiated in March — but it is not expected that the fund or European officials will back wholesale changes.

“We are talking about ensuring that Greece gets a government and that this government takes full ownership of the program and implements it to put the country back on track,” European Commission spokesman Amadeu Altafaj said at a briefing in Brussels, the Athens News Web site reported.

Euro zone’s troubles

Greece’s travails are just one of many problems threatening to pull the euro zone apart and put the broader world economy in danger. Spain’s borrowing costs are rising, support for the Italian government is waning, and the region’s top leaders seem deadlocked between competing visions — of a Europe of efficient production and thrift advocated by German Chancellor Angela Merkel, and one of shared debt and a solid social contract championed by newly elected French President Francois Hollande.

The prospect of an imminent and chaotic Greek departure from the euro zone posed a particularly acute risk, with the potential to destroy confidence in the currency union’s integrity and drive larger nations toward bankruptcy. That short-term threat seems to have lessened with Samaras’s victory over Syriza, a party that threatened to revoke the international bailout and possibly set the stage for a euro-zone exit.

What it means for Greece’s long-term problems is less certain.

The top economist at the central bank of Greece recently totaled the different forms of assistance the country and its banks have received from the rest of Europe and the IMF over the past two years, and the figure is stunning: more than half a trillion dollars, an amount twice the size of the country’s economy.

That total includes more than $120 billion in losses shouldered by owners of Greek government bonds, a step that eliminated a large chunk of the country’s outstanding debt and dramatically lowered its annual debt payments.

Yet despite that massive infusion of outside help and more than two years to work on its problems, Greece is still running deficits in key areas, leaving it no choice but to rely on the flow of loans from Europe and the IMF to meet basic obligations such as importing oil and food and paying pensions and government salaries.

Samaras in spotlight

The slow adjustment has officials and economists concerned about the pain still ahead if Greece is to become self-supporting and restore enough confidence for outside investment to flow again — or even for local residents to put money back in their bank accounts. It now falls to Samaras, an initial opponent of the bailout who endorsed it only under pressure from the rest of Europe and in light of Greece’s dwindling fortunes, to chart a path forward.

Greece’s promised work under the bailout program is behind schedule, and Samaras would take office facing an urgent set of potentially unpopular decisions. Chief among them is how to trim about $11 billion, or roughly 5 percent of the economy, from government spending over the next two years, a sum expected to come largely from welfare programs considered generous to the middle class.

That is one area in which he may ask for additional time so he does not have to pull more from the economy and risk an even worse recession. Delaying the cuts, however, would require more loans from the outside — a difficult request after so much has been provided already.

More troubling to some economists is the fact that Greece’s current account — the sum of its economic ties with the rest of the world — is running a deficit that remains equivalent to about 10 percent of the size of the economy.

In other countries in crisis, the IMF has noted, the current account is quick to adjust as the collapse in incomes, for example, leads people to purchase fewer imports and require less outside financing. But that has not happened to the same extent in Greece. One important mechanism — the drop in local exchange rates that makes imports more expensive in a crisis — is not at work in Greece, because it shares the euro currency with its major trading partners.

The remaining high current account deficit, economists argue, means Greece’s wage levels need to continue falling so businesses find it a cheaper place to operate and begin to make products here for local consumption or, even more desirably, for export.

The situation, some feel, means a Samaras government would be inherently unstable. Europe “isn’t prepared to make any substantive change,” said Seraphim Seferiades, a political scientist at Panteion University. Changes “will be cosmetic, and when it is shown to be cosmetic, these [political] parties will be very much diminished.”