BERLIN — It's the pipeline that just got a new lifeline.

Over the past few years, Gazprom’s controversial plan to build Nord Stream 2, a second 1,200-kilometer Baltic pipeline between Germany and Russia, has suffered several serious setbacks, only to rise again.

Its latest lease on life comes courtesy of the likely return of the Social Democrats to a role in the German government.

Up until last month, senior German foreign ministry officials were expecting Nord Stream 2, a key priority of Russian President Vladimir Putin, to collapse. Germany looked headed for a three-way coalition between conservatives, Greens and liberals, the latter two of which voiced skepticism about the project.

A strong signal of disapproval from a new German government could stop the project in its tracks. It would force the pipeline's European backers, which include stock market listed companies, at least to review their commitment. Such a move by the EU's leading political power could also prompt politicians and regulators outside Germany to adopt a more critical stance.

“Now is a good time for us to intensify our economic cooperation. We’ve always known Russia as an especially reliable gas supplier" — Sigmar Gabriel, German foreign minister

German officials say they had hoped to use Nord Stream’s expected demise as a bargaining chip in talks with Poland, which is dead set against the pipeline. In exchange for backing away from Nord Stream, Berlin wanted Warsaw to drop demands that Germany pay war reparations. The reparations call has further soured already strained ties between Poland’s nationalist government and Berlin, and German officials saw ending Nord Stream 2 as a way to put the relationship on a new track.

That plan all but died the moment the three-way coalition talks collapsed.

With the Social Democrats (SPD) now back in the coalition picture, Nord Stream 2 is alive and kicking. Foreign Minister Sigmar Gabriel, the SPD’s leader until last year, was an early advocate of the €9.5 billion project and has made it clear he continues to stand behind it.

“Now is a good time for us to intensify our economic cooperation,” Gabriel said during a visit to St. Petersburg in late November. “We’ve always known Russia as an especially reliable gas supplier.”

Not everyone shares his enthusiasm.

A number of Central and Eastern European countries oppose the project because it would rob them of lucrative transit fees they now receive from Russia. A deeper concern is that the pipeline would leave Europe at Moscow’s mercy when it comes to energy. Together with the existing Nord Stream 1 connection, the new pipeline would concentrate 80 percent of the EU’s Russian-imported gas along the route. Russia accounts for more than 40 percent of gas consumption in the EU.

Germany’s official position is that Nord Stream 2 is a “commercial project” and that the government has no reason to get involved.

Critics of the project say that line is a smokescreen. They note that Nord Stream 1 isn't running at full capacity, suggesting there isn't a strong business case for a second pipeline. Even if there was, it's difficult to deny Nord Stream's impact extends well beyond the business sphere.

“It's clearly not a commercial project,” said former Danish Prime Minister and NATO Secretary-General Anders Fogh Rasmussen, who now works as an adviser to Ukrainian President Petro Poroshenko, an outspoken opponent of the pipeline.

The Social Democrats have long viewed deepening economic ties with Russia as a way to defuse East-West tensions.

“It's political, to make Europe even more dependent on imported Russian gas and to circumvent Ukraine and other eastern partners,” he told POLITICO.

Many in the German government agree with the Dane.

Merkel's dilemma

The resistance to Nord Stream in Eastern Europe and other corners of the EU has put German Chancellor Angela Merkel in an awkward position. The planned end point for the pipeline is in her home constituency on the Baltic. German business, both large and small, has a lot riding on its completion, projected for 2019. German energy companies Wintershall and Uniper are among the biggest investors in the project.

Nonetheless, officials close to the chancellor say she would be willing to sacrifice the pipeline — if she could do so while avoiding a clash with the SPD. Berlin could pull multiple levers, from withholding construction permits to applying diplomatic pressure, to delay or derail the project. Germany could throw its weight behind the European Commission's push for a mandate to regulate the pipeline, for example. That would force Gazprom to accept more transparency and competition, something Moscow opposes.

If Merkel lands in another grand coalition, such a course won't be easy. The Social Democrats have long viewed deepening economic ties with Russia as a way to defuse East-West tensions.

The party has championed gas deals with Moscow going back to the 1970s. The strategy was an important aspect of the SPD’s détente approach, known as Ostpolitik, which many both inside and outside the party credit with helping to end the Cold War and paving the way to German reunification.

In the wake of Russia’s 2014 annexation of Crimea, it was the SPD that insisted on keeping lines to Moscow open. Both Gabriel and his predecessor, Frank-Walter Steinmeier, now Germany's president, have been tireless in trying to keep Russia at the negotiating table.

For some SPD officials, the Russia connection has been about more than just maintaining peace.

Gerhard Schröder, Germany’s former Social Democratic chancellor and a confidant to both Gabriel and Steinmeier, is the chairman of Gazprom-controlled Nord Stream. Schröder, who recently joined the board of Russian oil giant Rosneft, has used his connections in Germany and elsewhere in Europe to lobby for the pipeline.

Despite the SPD’s backing and Nord Stream’s history of surviving against the odds, the project still faces a series of challenges that could derail it.

Last month, Denmark's parliament passed a law that would allow it to keep the pipeline from running through Danish waters, as planned, a move that could force a costly repositioning of Nord Stream 2. An even bigger hurdle is the European Commission. If it succeeds in inserting itself as a regulator, the Russians might conclude the project isn't worth the investment. In addition, the U.S.’s latest round of sanctions against Russia could complicate Nord Stream 2’s financing because the companies backing the project, a group that includes Royal Dutch Shell and Austria's OMV, would want to avoid falling afoul of U.S. law.

"They've managed to divide Europe, so the benefit for the Kremlin has already been achieved" — Joerg Forbrig, a Berlin-based senior fellow with the German Marshall Fund of the U.S.

Political resistance in Europe, meanwhile, could become so intense that Germany would have to drop its support, despite the SPD's affinity with the project.

“Germany has bungled the process to such a degree that a change of direction can only be triggered from outside,” said Joerg Forbrig, a Berlin-based senior fellow with the German Marshall Fund of the U.S. “There’s a very good chance that the project won’t happen.”

Even if Russia, which has abandoned pipeline projects before, decides to pull back from Nord Stream 2, it may have already achieved its political goals.

"They've managed to divide Europe, so the benefit for the Kremlin has already been achieved," Forbrig said.