Nuclear power has been falling out of favor in Europe ever since the Chernobyl disaster in 1986. Italy has closed all its reactors. Germany, Belgium, and Switzerland are in the midst of retiring their fleets. Even France, which gets 77 percent of its electricity from nuclear, has been discussing a partial phaseout.

Yet for a continent that prides itself on being a leader on global warming, shutting down a major source of reliable, carbon-free electricity isn’t always easy. And Sweden is a great case study here.

Until recently, Sweden's nuclear reactors — which provide 40 percent of the nation's electricity — were on track to close prematurely in the coming years, as government policies favored renewables. But last week, the country switched course. Under a new agreement, Sweden will get rid of a key tax that had been hurting nuclear, allowing existing reactors to keep running for longer. The country’s utilities will also now be permitted to build up to 10 new reactors to replace those scheduled to retire. (Though whether they actually do is an open question.)

Officially, Sweden still has a goal of moving to 100 percent renewable energy by 2040. But this new policy is, effectively, a backstop. If it turns out to be much harder than expected to power the entire country with wind, hydro, and solar alone — as some experts think it could be — then nuclear power will remain a ready option.

Why Sweden's nuclear reactors were in trouble

A quick bit of history: After the OPEC oil crises in the 1970s, Sweden went on a nuclear-building spree to cut its fossil fuel dependence. This was one of the fastest feats of decarbonization the world has ever seen, along with France’s nuclear buildout. Here’s a list of the country’s nine current reactors, sited at three locations:

Nuclear power remains controversial — the country has been debating phaseouts since 1980 — but it does provide real benefits to Sweden’s grid. These nine reactors supply 40 percent of the country’s electricity (hydropower provides another 50 percent, with the rest from wind and fossil fuels). Sweden now has one of the lowest-emission grids on the planet. And the nation exports surplus electricity to its neighbors, particularly Finland.

But in recent years, Sweden’s nuclear reactors have become starkly unprofitable. On June 10, it cost 3.8 cents per kilowatt-hour (kWh) to operate these reactors, on average. But operators only received around 2.6 cents/kWh for their nuclear electricity.

Why the shortfall? Operating costs have increased in recent years, not least because plants have been required to adopt more stringent safety requirements after the 2011 Fukushima meltdown in Japan. At the same time, electricity prices have plummeted, partly due to economic malaise in Europe and partly due to subsidies that have made wind power artificially cheap in the Nordic power markets.

There’s also a third reason: Ever since 2000, Sweden has levied a tax on nuclear power that recently got ratcheted up to nearly 1 cent per kWh. This tax helped raise revenue for renewable investments, reaping $484 million last year. But it was also driving nuclear out of business. Vattenfall, the company that operates seven of these reactors, warned that unless the tax was modified, most of the country’s nuclear power would be shut down by 2020, well ahead of schedule.

That looming shutdown posed a dilemma. Many greens wanted to keep the tax, phase out Sweden’s nuclear fleet, and replace that power with wind and solar. But this was looking quite challenging to pull off in practice.

One key difficulty is that nuclear power plants run around the clock, whereas wind power is much more variable (operating at capacity around 30 percent of the time). One peer-reviewed study found that to replace 9,000 megawatts of nuclear capacity, Sweden would have to build more than 22,000 megawatts of wind capacity, plus about 8,600 megawatts' worth of gas turbines for backup power. By some estimates, building that much wind and gas would cost twice as much as simply keeping the existing reactors open for their remaining life spans.

There’s also the question of what to do during Sweden's winter, when electricity demand for heating soars but wind turbines often shut down due to extreme cold (and solar output drops sharply).

A 2015 study in Energy Policy found that a premature shutdown would raise Sweden’s system costs "disproportionately." Another study in The European Physical Journal Plus found that replacing the entire nuclear fleet with wind and gas would cause Sweden’s electricity CO2 emissions to double. Swedish industry groups — heavy electricity users like Volvo or steelmaker SSAB — lobbied to save the reactors.

How Sweden’s reactors got a second chance

Ultimately, the prospect of a premature shutdown seemed too daunting. Last Friday, Sweden’s governing Social Democrats and Greens reached a deal with the opposition to scrap the tax on nuclear power over the next two years, giving the existing reactors some room to avoid early closure. They also agreed to permit utilities to build up to 10 reactors at existing sites to replace the ones coming offline in the coming decade.

Shortly after the agreement, Vattenfall approved safety upgrades at the three reactors at Forsmark, enabling the plants to continue operating well past 2020.

The government still has a goal of 100 percent renewable energy by 2040, but the agreement states this doesn’t necessarily rule out nuclear: "This is a goal, not a cut-off date that would prohibit nuclear power, and it does not mean either the end a closure of nuclear power." According to the Financial Times, Energy Minister Ibrahim Baylan said of the deal: "This is a traditional Swedish compromise."

There’s still no guarantee that Sweden's utilities will actually build new nuclear plants. These plants remain extremely costly to construct. Next door in Finland, the French state company Areva is building a 1,720-megawatt reactor now estimated to cost some $9.5 billion — three times the original price, thanks to delays and overruns. More recently (and controversially), a Finnish consortium decided to partner with Russia’s Rosatom to build a separate reactor in Pyhäjoki in the hopes of lowering costs.

It’s unclear what direction Sweden might go for new plants, but it can’t move forward unless the economics work out. The government isn't offering subsidies for new builds, and wholesale prices are extraordinarily low right now. So some analysts are skeptical that we'll see a future boom.

In any case, it could be interesting to compare Sweden with Germany in the coming years. Germany, as part of its Energiewende plan to tackle global warming, is hoping to get 80 percent of its electricity from renewable sources by 2050 (it’s at 31 percent now). Making this task tougher, the country is attempting this while retiring its unpopular nuclear fleet. You can read about some of Germany's challenges here.

There’s endless debate among energy wonks over whether it's really feasible to power an entire grid with renewables alone. Germany is betting it (mostly) is. Sweden now appears to be hedging.

Further reading:

-- Note that some US states — like California and Illinois — are seeing their own debates on whether to save nuclear reactors that are scheduled to shut down prematurely. Amy Harder has a good state of play here.

-- Sweden also had an interesting strategy for managing its nuclear waste. Rather than having the government decide unilaterally on a site for long-term geological storage (as the US Congress tried with Yucca Mountain in Nevada), policymakers drew up a list of potential sites and then consulted closely with local residents. The two finalist communities ended up competing against each other to host the waste site (which would mean jobs, money, and so on). The Energy Department has suggested a similar approach here.

-- Why America abandoned nuclear power (and what we can learn from South Korea)