By Julien Ponthus and Mark John
PARIS (Reuters) - As President Francois Hollande led Angela Merkel off for a working dinner at his Elysee Palace a week ago last Monday, his advisers breathed deep sighs of relief.
Minutes earlier, the German chancellor had agreed to echo Hollande in telling reporters that the "door remains open" to a deal between Greece and its international creditors.
Spoken 24 hours after Greek voters rejected the cuts and tax hikes sought by the European Union and International Monetary Fund in return for more financial aid, Merkel's words suggested Greece's forced exit from the euro zone could still be averted.
"That could turn out to be one of the sentences that saved Greece," said one diplomat, reflecting the French view that expelling the country from the single currency zone would have catastrophic consequences for Greece and weaken the euro itself.
While the final accord struck between Athens and euro zone leaders in Brussels on Monday imposes tough new conditions on Greece demanded by Merkel and her allies, the fact that Europe got there at all after six months of brinkmanship and frustration is in no small part due to France.
While few doubt Germany remains the senior partner in the region, the saga has shown that France still plays a counterweight role in defining the European Union.
It also bucks a period in which France's standing and influence have suffered because of a weak economy and repeated failures to bring its own public deficit under EU limits.
"If 'Grexit' is avoided, it will show that Hollande has been a bridge-builder and helped avoid a geo-political catastrophe," said Rem Korteweg, senior researcher at the London-based Centre for European Reform (CER) think tank.
On coming to power in May 2012, Hollande mulled leading a rebellion of southern EU states against the bloc's Berlin-driven fiscal austerity. But he concluded it was not in the best interest of France's borrowing costs for it to be ranked alongside fragile "Club Med" economies.
While that choice dismayed many fellow Socialists, Hollande was quick to see this year that the stand-off on Greece - whose 1981 entry into the EU France had lobbied for in the first place - offered the chance of a new leadership role.
When Alexis Tsipras won power in January elections, Paris had within hours offered to be a "bridge" between his leftist government and the rest of Europe.
"HELP ME TO HELP YOU"
What followed was dogged, consensus-building diplomacy typical of Hollande, an alumnus of France's elite ENA civil service college.
"I told Tsipras, 'it's not easy for Mrs Merkel'," Hollande recounted privately in late June of the need for any accord to be politically acceptable in Berlin.
As the patience of other EU leaders wore thin with Tsipras' refusal to meet their demands and with his incendiary rhetoric, Hollande remained convinced that the former Communist youth leader was at heart a pragmatist who just needed help on the learning-curve of Brussels deal-making.
"Help me to help you," he finally told Tsipras by telephone on the evening of Sunday, July 5 as results in Greece's referendum showed a decisive rejection of EU and IMF austerity. Hollande urged Tsipras to mend fences quickly with EU leaders.
The removal the following morning of combative Finance Minister Yanis Varoufakis and a new conciliatory tone in Athens helped set the stage for a fresh effort to reach a compromise.
While Merkel could only react guardedly, due to growing pressure from fellow German conservatives to cut Greece loose, Hollande knew his firm anti-Grexit line could only win him kudos with the French left.
Prime Minister Manuel Valls declared in parliament on Wednesday that France would prevent any move to eject Greece, and France discreetly activated some of its best negotiators to help Greek officials fine-tune new concessions to creditors.
"We don't have teams of technicians drafting the package for the Greeks," one senior French diplomat said, denying the French were writing the Greek proposal. "It's more about giving them a hand on the politics - encouraging them to put in what is possible now, to do the necessary."
That set the stage for this weekend's show-down in Brussels - but once there, Berlin took over. Aside from helping discredit an option of "temporary Grexit" put about by German officials, the French were mainly bystanders as Merkel, backed by northern, eastern and Iberian countries, imposed conditions.
"Greece remains in the euro zone - that was our goal," a weary-sounding Hollande told reporters after the summit, calling Franco-German compromise a precondition for every EU deal.
While the past few months have shown that France still counts in Europe, it would be premature to say EU power dynamics have swung back in Paris' favor or that Hollande will see a bounce to his still-dismal domestic ratings.
CER's Korteweg noted that for Merkel, the center Hollande was a valuable "go-to partner" for brokering political consensus across Europe who also provided cover for diplomatic forays into the Ukraine crisis. The Germans are anxious not to be seen to be wielding their increased power alone.
In France, Monday's agreement means Hollande has at least avoided the ignominy of watching his efforts going to waste and then having to suffer the ridicule of his predecessor and likely 2017 election rival Nicolas Sarkozy.
But recent polls show the French still believe it is Merkel not Hollande who calls the shots in Europe, and that around half of them would have been happy to see Greece leave the euro zone.
"Don't fall into the trap of thinking the French are massively behind the Greeks," said Jerome Fourquet, head of opinion at pollster Ifop.
"Many will rapidly come to the conclusion that all we've done is stick another patch on Greece's punctured tire."
(Additional reporting by Elizabeth Pineau; editing by Paul Taylor and Janet McBride)