The leaders of Germany and France clinched agreement on a joint European-IMF financial safety net for debt-stricken Greece just before an EU summit on Thursday, the French president's office said.

The accord, which set the stage for a wider deal among euro zone leaders, is intended to reassure nervous financial markets and arrest a crippling rise in Greece' borrowing costs after a debt crisis that has shaken confidence in the euro.

The European Central Bank also took a key step to support Greece by extending softer rules on collateral so that Athens does not risk a guillotine on its debt at the end of this year.

A French official said President Nicolas Sarkozy and German Chancellor Angela Merkel had agreed in private talks in Brussels on a text ... which describes very precisely the conditions on which euro zone countries could be called upon to intervene.

Under the arrangement, euro zone countries would provide the majority of any funding for Greece, with rigorous conditions set by the European Commission and the ECB, and the International Monetary Fund would contribute money and expertise.

The mechanism would be triggered only if there were very serious difficulties and there was no other solution, the French official said.

A German official said euro zone states would have to agree to activate the plan, giving Berlin a veto.

After weeks of public argument over whether and how to help Greece, Merkel signaled in parliament that she would accept a contingency plan provided the IMF was involved and EU partners agreed to toughen the bloc's budget deficit rules.

The German government will push its view that any emergency support should come from a combination of the IMF and joint bilateral help from the euro zone. But again I say, this can only be a last resort, she told parliament in Berlin.

A good European is not necessarily one who offers help quickly. A good European is one that respects the European treaties and national rights so that the stability of the euro zone is not damaged, Merkel said.

The French spokesman made no mention of stricter punishment for deficit sinners, saying only that Merkel and Sarkozy agreed on a reinforcement of economic governance -- a vague term that covers coordination of economic policies.

However, an EU official said any agreement would include increased budgetary surveillance of euro zone countries.

ECB LIFELINE

Some euro zone states, notably France, and ECB policymakers have previously opposed IMF involvement, arguing that such a move would underscore the single currency area's inability to solve the deepest crisis in its 11-year existence on its own.

Greek Prime Minister George Papandreou told reporters his country would press ahead with painful austerity measures to slash a huge budget deficit regardless of what EU leaders decided at the two-day meeting.

ECB President Jean-Claude Trichet earlier offered some good news to Athens, announcing that the central bank would extend looser collateral rules, which were due to expire at the end of this year, into 2011.

Greece was at risk of having its bonds rejected as collateral for refinancing with the expiry of the relaxed rules, potentially triggering an even deeper liquidity crunch.

It is the ECB's contribution to the resolution of the Greek crisis, said Nomura economist Laurent Bilke. It is also a message to the EU that Greece deserves support.

Spreads between Greek bond yields and German benchmarks narrowed slightly after Trichet's announcement.

Athens is still saddled with borrowing costs more than double those of Germany and must borrow some 16 billion euros between April 20 and May 23 alone to refinance maturing debt.

The new Socialist government revealed on taking office last October that the budget deficit was more than twice the previous estimate, shocking investors who dumped Greek debt.

Greece says a standby aid package from the EU would reassure credit markets and avert the need for it to request aid.

Greece is determined to deal with its own problems, put its own house in order, said Papandreou. We have already ... embarked on a journey of major radical reform.

Whatever the decision taken today, Greece will move ahead in a positive manner and in the right direction, he said.

CONSENSUS FORMING ON IMF-EU AID

Swedish Prime Minister Fredrik Reinfeldt said Stockholm was prepared to offer bilateral aid to Greece if the IMF was involved, even though Sweden is not a member of the euro zone.

Germany, Europe's biggest economy, faces overwhelming public opposition to any bailout for Greece and fears that direct euro zone assistance would face legal challenges at home.

Merkel had an extra incentive to stick to her guns ahead of a crucial state election on May 9, where defeat would erase her center-right majority in the upper house of parliament.

The German people gave up the deutschmark based on their faith in a stable euro. This faith, and this is the view of the entire German government, cannot be disappointed under any circumstances, she said.

Without a fallback mechanism, EU leaders fear Greece's debt problems could spread to other countries in the euro zone including Portugal, Spain or Italy.

Fitch downgraded Portugal's sovereign debt rating by one notch to AA- on Wednesday. The Portuguese opposition cleared the way for parliament to approve the government's austerity budget later on Thursday by saying it would abstain.