Instead, Berlin owes Paris a thank-you note, and the alliance at the heart of Europe grew a little stronger Friday.

What had looked like a failure by Germany to stop work on a revamp of the Gas Directive — which would apply EU rules to the Russia-backed Nord Stream 2 pipeline supported by Berlin — ended up as a face-saving compromise thanks to some last-minute maneuvering.

On Thursday, Paris indicated it would back reforming bloc rules for the gas market, which would beef up Brussels' role in governing the energy market. Effectively that would have sucked power to regulate pipelines and allocate capacity on lines like Nord Stream 2 away from Berlin, and handed it to Brussels.

That sparked fears that the bilateral relationship — recently celebrated with the pomp and ceremony of the Aachen Treaty, and bolstered by the bilateral dismay over this week's Commission decision to kill the rail merger of Alstom and Siemens — was in trouble. More wobble worries came from French President Emmanuel Macron's decision to skip a planned appearance with Chancellor Angela Merkel at the Munich Security Conference later this month.

"Regarding the Gas Directive, we have reached an agreement and this was possible because Germany and France worked closely together" — Angela Merkel, German chancellor

But in the end, the Franco-German motor that has powered the EU for decades purred into life, and a bilateral compromise on the Gas Directive was supported by almost all member countries.

The new language shifts responsibility for regulating pipelines coming to the EU from third countries to the country where such a pipeline lands — in Nord Stream 2's case, Germany. The revamped directive would apply EU energy rules to the pipeline, which means that Gazprom would no longer be able to be its sole operator — affecting its bottom line.

That was seized on by Poland, which has led opposition to Nord Stream 2, fearing the Kremlin would use it as a geopolitical weapon against its former empire.

"It is true that [the] first contact country — Germany in the case of Nord Stream 2 — would have the authority to enforce the regulations," Poland's European Affairs Minister Konrad Szymański told POLITICO after the Friday meeting.

"But it will have to be under EU rules, Commission and European Court of Justice supervision," he said. The compromise calls on the country in which the pipeline hits Europe to consult with other neighboring countries, but also sets in place time limits.

But Warsaw's bid to block the pipeline from being built at all is dead.

Both Paris and Berlin hailed the compromise.

"Regarding the Gas Directive, we have reached an agreement and this was possible because Germany and France worked closely together," Merkel told reporters.

The French government also indicated that there is no crisis in relations.

The common approach came in the face of furious protests from the U.S., which wanted the pipeline killed — a sign of how an unpredictable Trump administration is driving Paris and Berlin closer together.

A trio of U.S. ambassadors — including Washington's envoy to Berlin Richard Grenell — urged countries to block the Nord Stream 2 project in an op-ed in German media published Thursday.

“The Germans should take the concerns of their neighbors seriously,” the diplomats wrote ahead of the ambassadors meeting in Brussels. “The opinion of the European Union is clear: more than half of the EU member states have already spoken publicly against Nord Stream 2.”

U.S. President Donald Trump wants a larger market for American liquefied natural gas and has called out Germany for backing Russia on the project.

But even though Berlin won its battle in Brussels to keep control, it isn’t winning friends with its approach to the Nord Stream 2 project, said Jacopo Pepe from the German Council on Foreign Relations in Berlin. In addition to annoying Washington, Warsaw has seized on the issue as a demonstration of how Germany puts its own interests above those of its neighbors.

“Opposition to subjecting Nord Stream 2 to EU rules has created a loss of credibility for Germany,” said Jean-Arnold Vinois, an adviser at the Jacques Delors Institute and a former mandarin at the European Commission handling energy policy.

"Today is a good day, and that is because of French-German cooperation" — Angela Merkel

He said the pipeline means 60 percent of Germany's gas will come from Russia, marking a steep rise in dependence which is “completely frustrating” for other EU countries.

“What is at stake is economic interests,” Vinois said.

Further battles lie ahead. The directive itself has to be agreed in talks with the European Parliament, where Poland will fight a rearguard action. Berlin and Paris also remain divided on plans to reform the European Monetary Union and on key foreign policy issues, while Merkel and Macron may back different candidates to be the next Commission president. But, for now at least, the alliance remains on course.

"Today is a good day, and that is because of French-German cooperation," Merkel said.