In reaching the agreement, Papandreou agreed to meet Samaras' demand that he step down as prime minister, while Samaras agreed to back the debt deal and a seven-point plan of priorities proposed by Papandreou that would essentially commit the new government to the terms of the debt deal.

ATHENS, Greece — Prime Minister George Papandreou and his chief rival agreed Sunday night to create a new unity government, under a new prime minister, that will move ahead with the country's debt-relief deal with the EU and then hold new elections. Papandreou agreed to resign once the details are completed Monday.

The agreement appeared to break a political deadlock that had paralyzed Greece in the face of an acute financial crisis that threatened to infect other eurozone nations, especially Italy. European leaders see the debt-relief deal struck with Greece on Oct. 26 as crucial to containing the crisis in Greece and insulating Italy, a much larger economy whose political leaders have also struggled to cut budgets and deal with heavy debt.

The agreement in Greece could not have come soon enough for its European partners, who have pressed the country hard to forge a broader political consensus behind the debt deal. But it was not clear whether the agreement would provide the certainty that skeptical investors are demanding to calm turbulent financial markets.

The debt deal requires that the Greek Parliament pass a new round of deeply unpopular austerity measures, including layoffs of government workers, in a climate of growing social unrest. It also calls for permanent foreign monitoring in Greece to ensure that it makes good on its pledges of structural changes to revitalize its economy, a requirement that many Greeks see as an affront to national sovereignty.

With a narrow and eroding majority in Parliament, Papandreou's Socialist government found that it could not unify to push through such measures on its own, but Antonis Samaras, the leader of the conservative New Democracy party, opposed many of the debt deal's provisions and demanded Papandreou's resignation and a snap election. After days of frantic political wrangling, Papandreou survived a confidence vote in Parliament on Friday, setting the stage for Sunday's compromise.

The new unity government is widely expected to be led by a nonpolitician, and to govern for several months, long enough to implement the debt deal and pass a budget for 2011. The name of the new prime minister and the composition of the new Cabinet are not expected to be announced until Monday, when the leaders will meet again, according to a statement Sunday night by the Greek president, Karolos Papoulias, who moderated the talks on Sunday.

In a statement early Monday, the Greek Finance Ministry said delegations from the Socialist Party and New Democracy met Sunday "to discuss the time frame of the actions" to implement the debt deal, and added that the two parties regarded Feb. 19 as "the most appropriate date for elections."

In reaching the agreement, Papandreou agreed to meet Samaras' demand that he step down as prime minister, while Samaras agreed to back the debt deal and a seven-point plan of priorities proposed by Papandreou that would essentially commit the new government to the terms of the debt deal.

Samaras is not expected to play a role in the unity government, but would be New Democracy's candidate for prime minister in the general election.

In many ways, a new interim government for Greece buys time for European leaders to put together a stronger bailout mechanism that would protect larger economies from the risk of default, chief among them Italy. High debt, low growth and the diminishing credibility of Prime Minister Silvio Berlusconi have made that nation increasingly vulnerable.

"The decision is very positive, because it will appease the markets and because it shows that Greek authorities are doing what foreign leaders want them to do — to get on with implementing the conditions for the EU debt deal," said Athanassios Papandropoulos, an economist and commentator for the conservative Greek newspaper Estia.

Still, he said, he saw little chance that a unity government could get Greece back on the road to economic, political and social recovery. "I don't think it will work," Papandropoulos said. "It will last three months, then we'll have elections, and then we'll have the same problems all over again."

Greece has rarely had unity governments. A civil war between right and left in the late 1940s left its political culture deeply divided, and it remains so nearly 40 years after the fall of a military dictatorship. But the dire economic situation has pushed Greece into uncharted territory.

In an unusually direct ultimatum to Greece, the EU commissioner for economic affairs, Olli Rehn, said Sunday that finance ministers from the 17 countries in the union that use the euro were expecting the announcement of a unity government before their meeting in Brussels on Monday.

Evangelos Venizelos, the Greek finance minister and a key figure in the Socialist government, is scheduled to attend the meeting.

In his efforts to head off the fall of his government and to maneuver Samaras into backing the debt deal, Papandreou proposed last week that the debt deal be put to a popular referendum. After the plan threw financial markets around the world into turmoil and European leaders reacted with fury, Papandreou withdrew the idea, but won a reversal from Samaras on the debt deal.

One name being mentioned as a possible leader of the new unity government is Lucas Papademos, a former governor of the Bank of Greece and a former vice president of the European Central Bank. He has been teaching at the Kennedy School of Government at Harvard since 2010, when he retired from the European bank, and has also been an informal adviser to Papandreou; he turned down an offer to be finance minister last spring, preferring to remain above the partisan political fray in Greece.

The new unity government will have its work cut out for it. Among the items on the seven-point plan Papandreou presented are completing the legal and financial terms of private sector involvement in the Greek rescue, in which banks holding Greek debt agree to voluntarily forgive much of its face value, to avoid a default.

The government also faces the challenge of securing the release of a new installment of 20 billion euros ($28 billion) in foreign aid that Greece needs by the end of February to stabilize its finances.

And it must approve the austerity measures that Papandreou's government accepted in its talks with the "troika" of foreign lenders — the European Commission, the European Central Bank and the International Monetary Fund. The layoffs and other cutbacks of Greece's public sector are likely to generate more angry street demonstrations.

The new government's success "will depend on the stance labor unions will take," said Babis Papadimitriou, a political analyst for the daily newspaper Kathimerini and for Skai television. "This will be, maybe, one of the most interesting developments: what will be the relations between unions and the main parties."

Landon Thomas Jr. contributed reporting.