This story was originally published by Mother Jones and is reproduced here as part of the Climate Desk collaboration.

The world’s most advanced energy revolution has hit an obstacle: the Trump effect.

Germany has long been a clean energy pioneer. Despite the fact that the sun hardly shines there, the country was the world leader in installed solar capacity until it was finally overtaken last year by China, a vastly larger and sunnier country. By 2050, Germany aims to get 80 percent of its electricity from renewable sources and to cut its greenhouse gas emissions by as much as 95 percent. It currently derives about one-fifth of its power from wind and solar (and one-third from total renewables), compared to just 5 percent in the United States. Even though this dramatic energy transition — known as the Energiewende — has contributed to higher household electricity costs, 90 percent of Germans say they support it.

For years, Germany’s mainstream political parties have supported clean energy, too. But that broad consensus could soon face a significant test, another possible casualty of the resurgence of right-wing, nativist politics across the Western world. Unlike many of its neighbors, Germany hasn’t had a far-right party represented in its parliament since World War II. But that’s almost certain to change next year, when national elections could make the Alternative for Germany party (known by its German acronym, AfD) the second- or third-strongest faction in the government, if polling trends continue. The party, which began as a Euroskeptic movement, has built its success on stringent opposition to immigration and admission of refugees — and on inflammatory rhetoric that echoes the campaign of Donald Trump.

Grist thanks its sponsors. Become one.

The AfD also opposes Germany’s clean energy policies. It’s calling for an end to the law behind the Energiewende and even questions the existence of human-induced climate change, stating on its website, “Scientific research on the long-term development of the climate because of man-made CO2 emissions is fraught with uncertainty.” Now, in an effort to slow the AfD’s rapid rise, the country’s mainstream parties could be poised for a step back in the fight against global warming.

It’s hard to overstate the importance of Germany’s energy transition. Several countries get a higher percentage of their electricity from renewables, but Germany’s economy and manufacturing industry are far larger, making the Energiewende a model for a cleaner future among economic superpowers.

“If it succeeds, it could be a great case study for the world,” says Sven Egenter, executive director of Clean Energy Wire, which provides information about the Energiewende to journalists in Germany. “And if it fails, it could be a great case study for the world.”

But Germany will almost certainly fall short of its emissions reduction target for 2020, for one reason: It can’t kick its coal habit. Germany still gets more than 40 percent of its electricity from coal — a higher share than in the United States or any other major Western economy. That’s in part because Chancellor Angela Merkel doubled down on the country’s commitment to abandoning nuclear power after Japan’s 2011 Fukushima disaster, shutting down eight plants virtually overnight and pledging to take all the others offline by 2022. Something had to fill the void, and renewable energy production wasn’t adequate to the task, so the reliance on coal continued.

Grist thanks its sponsors. Become one.

If Germany is to have any chance of meeting its longer-term targets, it will have to find a way to move off coal almost as quickly as it’s ditching nuclear. But there are several impediments to doing so. One is that wind and solar aren’t quite ready to take over. Even if their production numbers were sufficient, electricity storage and transmission would require major advances to make renewables the country’s primary electricity source.

And then there are the political hurdles — what Katharina Umpfenbach of the Ecologic Institute, an environmental think tank based in Berlin, calls “the Trump effect.”

During the U.S. presidential campaign, Trump promised to bring coal-mining jobs back to Appalachia (and bashed alternative energy sources like wind). Voters in the region — parts of which were once Democratic strongholds — responded enthusiastically. They waved “Trump Digs Coal” signs at rallies and voted for him by overwhelming margins. Market forces will make Trump’s coal promises nearly impossible to keep, but his victory is already having a very real impact in Germany. Politicians there are looking at Trump’s success among disaffected voters in coal country and seeing similar fears among their own constituencies in areas where coal production is being phased out.

Trump’s election capped a year of successes for the populist right that has left mainstream politicians scrambling to shore up their support. There was the British vote to exit the European Union, the resignation of Italy’s prime minister, the near-victory of a right-wing extremist in Austria, and the growing strength of the far right in France. Merkel, dubbed the “liberal West’s last defender” by the New York Times, is now facing her own insurgency in the form of the AfD. And so she and her coalition partners, the center-left Social Democrats, are tacking to the right to bolster their eroding support.

The biggest effect is likely to be on immigration and refugee policy: Earlier this month, Merkel proposed a ban on the face veils worn by some Muslim women. Anti-refugee sentiment has only climbed since then with the attack on a Berlin holiday market last week; the chief suspect is a Tunisian asylum seeker.

But clean energy advocates worry that the Energiewende could suffer as well. “My biggest fear is that the conservatives [in Merkel’s center-right Christian Democratic Union] get so nervous that they also move to the right,” says Annalena Baerbock, a member of the German parliament and the Green Party’s parliamentary spokesperson on climate policy.

Few lawmakers in Germany’s longstanding political parties — Merkel’s Christian Democrats, the Social Democrats, and the Greens, as well as smaller parties like the pro-business Free Democrats — would deny that the country ultimately has to move away from coal. That’s particularly true when it comes to lignite, a type of coal that is less efficient and burns dirtier than hard coal. Lignite alone accounts for half of the country’s carbon emissions in the electricity sector.

Just 20,000 Germans work in lignite mining, compared with at least 300,000 in renewable energy, according to Christian Redl of the think tank Agora Energiewende. (The coal industry says its figure is more like 100,000, according to Baerbock, if you include associated roles such as delivery workers.) “The issue is that it’s very concentrated in specific regions,” Redl says. “In those regions, huge numbers of people work in that sector, and there’s no renewables industry there yet.”

These regions are similar to Appalachia: economically distressed and reliant on a dying coal industry, but with an outsized influence on the political debate. One of the main regions is Brandenburg, just outside of Berlin, a portion of which Baerbock represents in the parliament. The center-left Social Democrats are doing all they can to maintain their strength in these coal regions as the AfD attempts to attract discontented voters by campaigning for the continued use of lignite to generate electricity. Already struggling to remain relevant as Merkel has established herself as the bulwark against the rising right, the Social Democrats can hardly afford to lose support among coal workers, a heavily unionized group that has historically backed them.

The political situation has created an incentive for the Social Democrats to drag their feet on the transition away from coal. It’s an uncomfortable development for Baerbock’s Greens, who laid the groundwork for the Energiewende while in a ruling coalition with the Social Democrats in the late 1990s and early 2000s.

“The Social Democrats in Brandenburg, they want to keep lignite running for decades,” says Philip Alexander Hiersemenzel, a spokesperson for Younicos, which is working to develop large-scale battery storage for renewable electricity, while giving a tour to journalists of the company’s industrial facility on the outskirts of Berlin.

Sigmar Gabriel, Germany’s economy and energy minister and the Social Democrats’ party chair, rejected calls this summer for a rapid phaseout of coal. In October, he said he expects Germany to continue burning lignite into the 2040s. (“That’s absolutely hilarious,” responds Umpfenbach, “because how will we reduce emissions by 95 percent if we still have coal?”)

Hubertus Heil, vice chair of the Social Democrats’ parliamentary group, said recently that if people in coal-producing regions were presented with an end date for the use of coal without a plan for economic assistance, “you might as well send them to the AfD right away.” (The Social Democrats’ press spokesperson did not respond to a request for comment.)

As Mother Jones reported in 2014, open-pit lignite mining has destroyed the landscapes of large swaths of Germany and has even threatened to swallow villages that stand in its way. But the devastation caused by mining could actually present an opportunity for the country to phase out coal without killing too many jobs. In the aftermath of the abrupt nuclear phaseout, I visited a small town in northern Germany whose nuclear plant had employed as many people as the town had residents. Workers there were upset at the sudden shutdown of the plant, but their frustration was mitigated by the knowledge that many of them would remain employed decommissioning the plant, a process that can take up to 15 years. Similarly, clean energy advocates suggest, some lignite miners could get jobs repairing and rebuilding the decimated landscapes of the former mines.

“It will take centuries to reconstruct the whole area,” says Baerbock, speaking in a conference room in the parliamentary office building, with a wide bay window looking out over rows of bicycle racks in the government quarter. Looming over that view is a towering smokestack from a gas-powered plant two kilometers to the north, a reminder of the work still to be done.

Residents of Appalachia have been turned off by what they see as decades of empty promises from politicians pledging to preserve coal jobs. Baerbock is determined to avoid the same fate. “We have to be very honest,” she says. “So I would never say this will not cost a single job, because I don’t believe this is true.”

The key is to manage the coal phaseout in a “socially inclusive” way, says Umpfenbach. For Germany’s mainstream parties, that means being more successful than U.S. Democrats have been in both retaining the support of voters in mining regions and sharply cutting greenhouse gas emissions. In other words, it means finding a way to sidestep the Trump effect by coming up with a concrete solution for coal regions that has evaded American politicians.

“In my point of view,” says Baerbock, “if we find a good solution for the workers, then it’s not so hard to have the discussion of the coal phaseout.”

Success or failure, the world is watching.