The nuclear reactors at the Indian Point Energy Center in Westchester County, New York, will stop operating by 2021, according to the plant’s owner Entergy Corporation. This confirms the New York Times’ report on Friday of the nuclear power plant’s impending shutdown.

The Indian Point Energy Center is home to three nuclear reactors, only two of which are active. It’s located on the edge of the Hudson river in Buchanan, New York — about an hour’s drive from Manhattan. Government officials are concerned that if a natural disaster or terrorist attack were to damage the plant, it could devastate nearby New York City.

“Record low gas prices” drove the plant out of business

“For years, my office has been fighting to address the serious risks posed by Indian Point to the surrounding communities and the environment,” New York Attorney General Eric T. Schneiderman said in a statement emailed to The Verge. “If we can shut-down Indian Point under an agreement that enhances public safety and kick-starts investment into safer and more reliable renewable energy sources, that will be a major victory for the millions of New Yorkers who live in the region.”

The plant has three full-time inspectors on site, and a specialist inspector visits periodically to check the plant’s security and radiation safety, Neil Sheehan, a public affairs officer with the Nuclear Regulatory Commission, tells The Verge. The Nuclear Regulatory Commission is the federal agency that oversees nuclear power plant safety. According to its latest safety report for the third quarter of 2016, there were no safety concerns that would warrant increasing federal oversight of the plant, Sheehan says.

The plant is one of 61 power plants operating in the United States, and it produces more than 2000 megawatts of energy. That’s enough for about 2 million homes, according to its website. It also employs nearly 1,000 people. “There are a number of reactors that have shut down in recent years,” Sheehan says. While there were a few plants closed for safety reasons, many were shuttered because of economics. “In most cases it had to do with challenges in the energy markets, the low cost of natural gas being a major factor.”

That’s true for Indian Point as well, according to a statement that Entergy Corporation emailed to The Verge. “Record low gas prices, due primarily to supply from the Marcellus Shale formation, have driven down power prices,” Entergy’s Bill Mohl said in the statement.

Officials worry the plant could endanger New York City

The agreement, first reported by the Times, will allow the plant’s owner to renew its license with the NRC to operate in the state. Entergy’s current licenses expired in 2013 and 2015. While the NRC is the body that grants the license, the state can block that process on two fronts. One of those is the plant’s water permit, which spells out how much water the plant can draw from the Hudson River to use for non-radioactive cooling purposes, Sheehan says. The other is certification under the Coastal Zone Management Act, which allows states to determine whether federal activities could endanger the state’s coastline.

Under the terms of the settlement, the state will allow those permits to go through. In return, Entergy will agree to fund environmental protection efforts to the tune of $15 million. Provided the state can find a new source of power by 2021, the reactors will be shut down by then: one in 2020, and one in 2021. If the state can’t find a replacement, the deadline could be extended by a few years, to 2024 and 2025.

Updated January 9, 2017 6:35PM ET: Updated to include new information about the shutdown of the Indian Point Energy Center and a statement from the plant’s owner, Entergy Corporation.