It started with a pump failure early on the morning of March 28, 1979.

Steam generators were unable to draw heat out of a reactor at the Three Mile Island nuclear power plant in Middletown, Pa. While an emergency shutdown was triggered, another problem — a stuck valve — was letting coolant escape from the ­reactor core.

The core’s fuel began to overheat, causing the partial meltdown and release of radiation that remain the worst nuclear accident in U.S. history. The reactor, one of two at the plant, has been silent ever since.

But just across the complex, 100 miles west of Philadelphia along the Susquehanna River, the other unit has been one of the region’s biggest power sources, churning out ­electricity for 45 years without incident. Next month, Unit 1, too, will come to an end. Plant owner Exelon Corp. is set to shutter the entire facility, 15 years before its license is set to expire.

One reactor was brought down by mechanical failures and human error, the other by the economics of the modern utility industry.

The shale revolution has made the U.S. the world’s biggest producer of natural gas. The abundance of the fossil fuel has dragged down its price, making it the largest source of the nation’s electricity. At the same time, wind and solar have been booming as the costs of components and installation fall.

It’s a state of affairs that makes it tough for nuclear reactors to compete. Seven U.S. power plants have shut down since 2013, and owners have announced plans to close several more. States, including New York, New Jersey and Illinois, have offered subsidies for nuclear power, but legislation to do the same in Pennsylvania failed in the face of strong opposition from supporters of renewables and gas.

Hollywood isn’t helping, either. The demise of America’s most notorious commercial facility comes amid renewed public interest in the downsides of nuclear energy, largely owing to the hit HBO miniseries “Chernobyl.” The five-episode drama that first aired in May laid out the events surrounding the April 1986 explosion at a power plant in Ukraine, then part of the Soviet Union. It was the worst nuclear accident ever.

Compared with the release of radiation at Chernobyl, which the United Nations estimated in 2005 may eventually kill 4,000 people, the accident at Three Mile Island was minor. Only a small amount of radioactive material was released, and it was later determined that the 2 million people in the surrounding area were exposed to less radiation than they would have received from a chest X-ray.

However, the immediate reaction to the event was characterized by fear and confusion. In the aftermath, public support for nuclear energy fell dramatically, and government oversight of the industry increased significantly.

Today, nuclear energy in the U.S. is at the center of a complicated debate. While cheap gas has upended the economics of operating reactors, whether to shut one down involves more than the bottom line.

President Donald Trump has taken steps to support unprofitable nuclear and coal power plants, citing national security issues because they generate electricity around the clock. Some of his efforts have been rejected by federal energy regulators.

Meanwhile, environmental groups have mixed feelings. Some are concerned about the accumulating nuclear waste that will remain deadly for thousands of years, as well as the potential for mishaps. Still others are alarmed by the threat of climate change tied to the burning of fossil fuels.

Either way, Three Mile Island won’t be part of the future of U.S. energy. Exelon will be switching off Unit 1 in a few weeks, and a decommissioning company is in talks to begin dismantling Unit 2.