PENNSYLVANIA has played a big role in the history of American energy. Coal has been mined there since the 1760s (Pennsylvania is sometimes called “the coal state”). In 1859 Edwin Drake drilled a rickety well that set off America’s first oil rush. More recently it has produced more natural gas than any other state except Texas, thanks to the vast Marcellus shale that runs beneath it. And though it barely advertises the fact, Pennsylvania is also America’s second-largest provider of nuclear energy—despite the near-disaster at Three Mile Island, a nuclear plant that suffered a partial meltdown of one of its reactors in 1979 (pictured, right), killing no one but scaring millions.

Today Pennsylvania is again at the centre of a shift in the energy industry and Three Mile Island is caught up in it. An abundance of natural gas piped out of the Marcellus shale in recent years has helped push power prices down so sharply that nuclear energy has struggled to compete in some parts of America. Three Mile Island’s remaining reactor, Unit One, is one of many fighting to survive—but this time its troubles are about costs, not safety.

In America and Europe slumping commodity prices are adding to the burden on nuclear power that was already growing after the 2011 Fukushima Dai-ichi nuclear disaster in Japan. America’s shale revolution, Europe’s growing supply of subsidised renewable energy and sluggish electricity demand in both markets have sharply cut wholesale power prices.

That makes it harder for many nuclear plants to cover their running costs, leading their owners to shut them down. Perversely, at a time when countries around the world are pledging to cut carbon emissions, such closures often lead to the burning of more fossil fuels. Adding renewable-energy capacity does not solve the problem: when the wind doesn’t blow and the sun doesn’t shine, nuclear energy still provides the best low-carbon source of reliable “baseload” electricity.

It is not all gloom in the nuclear industry. China plans almost to triple its nuclear generating capacity by 2020, and other emerging markets are also building new plants. But since Fukushima, all but two of Japan’s 43 reactors have been suspended, Germany is phasing out nuclear power and France intends to scale it back. Mycle Schneider, co-author of the World Nuclear Industry Status Report, says that a global total of 394 nuclear-power plants are operating, down from 431 in the pre-Fukushima year of 2010 (see chart 1).

More closures are coming, particularly of older single-reactor plants that need lots of workers even though they generate only modest amounts of power. In America the most vulnerable plants are in deregulated markets such as the Northeast and Midwest, where nuclear-power providers must compete to provide the cheapest electricity against rivals that use other fuels. Those in more regulated southern markets, such as Georgia, fare better because electricity prices are guaranteed to cover their costs. With such an assurance, on October 22nd the Watts Bar plant in Tennessee became the first new nuclear facility to be licensed in America in 20 years. (Similarly, the operator of Britain’s proposed Hinkley Point C nuclear plant will sell electricity at high fixed prices.)

Where markets are freer, it is harder for nuclear-power operators to make money, and too risky for them to build plants from scratch. Exelon, based in Chicago and the largest operator of nuclear plants in America, says that five of its 14 plants are vulnerable because of economic factors, including Three Mile Island’s Unit One, which it owns. “It’s ironic. People ask why we still operate a reactor there. But if gas prices were not [so low], it would be making money,” says David Brown of Exelon.

On October 13th Entergy, Exelon’s rival, which is based in New Orleans, said it would close its Pilgrim nuclear plant in Massachusetts, partly because its costs, at about $50 a megawatt-hour (MWh), are higher than electricity prices in the state, which have fallen to about $45/MWh. As The Economist went to press, it was due to decide whether to close a third, Fitzpatrick, in New York State. In December it closed one in Vermont, the fourth American nuclear plant to shut in the past two years.

The Nuclear Energy Institute, an industry body, says that last year generating electricity from a nuclear plant in America cost on average 2.40 cents per kilowatt-hour ($24/MWh). That is still cheaper than gas- or coal-fired power (see chart 2), but the nuclear average disguises wide variations. The least efficient nuclear plants have higher operating costs per unit of electricity than either coal or gas. Since the main cost of nuclear power is building the reactor in the first place, the narrowing gap in operating costs is ominous for the industry. And American gas prices are still plunging.

In Europe, where the generation and supply are mostly deregulated, prices of coal and natural gas have also come down, lowering the cost of electricity. Roland Vetter of CF Partners, a financial-research firm, says that in Germany and parts of the Nordic region, an increase in renewables generation (see chart 3) has also pushed down wholesale prices. Supported by subsidies, wind and solar plants earn more money than nuclear ones from generating power when prices are low.

As a result, Sweden’s nuclear industry is in particular trouble. On the banks of a forested North Sea inlet, the Ringhals nuclear plant has been part of the scenery in the western town of Varberg since 1969. As if in a promotional film for the industry, locals boat and fish in sight of the plant’s four reactors, while visitors to the plant’s information centre enjoy its collection of kitsch public art. It is one of the biggest employers in the area, with 1,600 members of staff. Yet Vattenfall, the state-owned utility that owns most of its shares, said on October 15th that it would retire its two oldest reactors in 2019 and 2020. In the same week E.ON, a German utility, said it would shut the oldest two units of the Oskershamn plant on Sweden’s Baltic Sea. Mr Vetter says that electricity prices in Sweden have sometimes fallen below nuclear operating costs. In addition, a leftist government, including anti-nuclear Greens, has imposed additional taxes on nuclear-power plants. “They are being squeezed between revenues going down and costs going up,” says Mr Vetter. The closures on both sides of the Atlantic represent a blow to an industry that for years talked about the prospect of a “nuclear renaissance” based on the merits of large scale, low-carbon energy. They show how Western governments have waffled in their support for the technology, opting to subsidise renewables rather than putting a real price on carbon emissions that would more heavily penalise dirtier fuels, such as coal and gas, and thereby promote nuclear energy. The closures also highlight how green NGOs, many of which were created to oppose both military and civilian use of atomic energy, have influenced the debate on nuclear power. Many greens still see it as an evil akin to global warming. Their biggest success has been in Germany, already busy with a zealous transition to renewable energy that it calls the Energiewende. Four years ago Germany announced that it would close all 17 of its nuclear plants by 2022; it has already shut nine. France, long Europe’s nuclear champion, passed a bill in July mandating that the share of nuclear power in the country’s electricity mix be cut from 75% to 50% within ten years. Both countries promise that the nuclear shortfall will be made up with renewable sources, mainly wind and solar.

Yet when nuclear plants close, that promise is not necessarily kept. Germany’s nuclear plants once produced over 20% of its power. As it has begun to shut them, the proportion of electricity produced by coal-fired plants has increased, which has pushed up carbon emissions. Sweden’s government claims that nuclear plants, which provide 50% of the country’s baseload electricity, will quickly be replaced with renewable energy, mostly from wind farms (more hydroelectric dams are out of the question). But Yvonne Fredriksson, a former director-general of the Swedish Energy Markets Inspectorate, dismisses that as a “naive 1980s idea”.

INTERACTIVE MAP: Our guide to the world's nuclear-power producers In America, too, the question of how to replace lost nuclear capacity is causing alarm. Grid operators worry that their dependence on natural-gas-fired electricity could lead to power cuts and wildly fluctuating peak prices, especially during freak weather conditions, because of the shortage of storage and pipelines. On the coldest day of a “polar vortex” storm that lashed the eastern United States in 2014, Pennsylvania-based PJM, America’s largest grid operator, found itself 22% short of generating capacity. To avoid this happening again, some operators, such as PJM, have thrown the nuclear industry a lifeline by paying a quasi-insurance policy to providers who can guarantee supply at peak times. Exelon said that these large advance payments have enabled it to defer decisions on the closure of two of its nuclear plants in Illinois. Cheered by these “capacity auctions”, the industry hopes that Barack Obama’s Clean Power Plan, launched this summer to reduce America’s carbon emissions, will bolster recognition of the value of nuclear power. In fact, the nuclear industry is unlikely to benefit much. The Nuclear Energy Institute, a lobby group, complains that the plan does not give credit to nuclear-power companies that go through the costly process of renewing their licences, allowing them to extend their operations beyond the 40 years originally allotted to them. A report by Third Way, a climate NGO, estimated that even if all the 100 or so reactors in America were granted extensions to 60 years (more than 70 of them have already been approved), emissions would go up because growth in electricity demand would spur more use of natural gas. “If America’s nuclear plants begin retiring in droves, achieving the Clean Power Plan emissions reductions could be impossible,” it said. The looming closures bring a further headache: the uncertainty over decommissioning old plants. Nuclear-power companies set aside large sums for this, but the challenge is complicated by the fact that neither America nor most European countries have found adequate sites for permanently storing nuclear waste. Uncertainties like this add to the prohibitive cost of building new nuclear-power plants. They also highlight why governments should shape energy policies to keep existing reactors running: they provide a reliable source of low-carbon energy, and decommissioning them is as likely to create safety problems as leaving them running.

Instead, Western governments tend to tilt the ground against nuclear plants by subsidising the alternatives or imposing heavy taxes. That means their nuclear industries will continue to ebb. More than three-quarters of nuclear plants in the rich world are 25 years old or more. In the coming years the number of them shutting down is only likely to accelerate.