HAMILTON TOWNSHIP, N.J. — Like many 57-year-olds, the Mercer Generation Station can still do its job, which is producing electricity from Appalachian coal for a public hungry for power. But this former workhorse of the grid has been eclipsed by a new generation of power plants, and on Thursday it will shut down for good.

Public Service Enterprise Group of Newark, N.J., announced in October that it would shut down Mercer and the Hudson Generation Station on June 1, retiring its two remaining coal-fired power plants in New Jersey, casualties of a sustained low-price environment brought on by inexpensive natural gas.

The closures take place just six years after the company's power-generation subsidiary, PSEG Power, completed more than $1 billion in upgrades to environmental controls at the two sites to comply with new federal emissions standards. Though the company correctly anticipated stricter environmental regulations, it did not foresee the tumble in energy prices brought on by shale gas.

"We made a bet on high gas prices," Ralph Izzo, PSEG's chief executive, said in an interview last week. "We got that wrong." The company took a loss of $555 million last year on the plant closures and anticipates an additional non-cash write-off of up to $960 million in 2017.

Environmentalists claimed credit for forcing the two coal plants to close, but PSEG says it was really fracking that undermined them. "The way the market works, the economics don't work," Bill Thompson, PSEG Power's senior director of operations, said during a Mercer plant tour last week. "They're not getting shut down for equipment conditions. It's just economics."

The Mercer station, just downriver from Trenton, was built when Dwight D. Eisenhower was in the White House and can produce 632 megawatts, slightly more than the Hudson plant. Mercer performed like a star professional athlete for much of its career, before moving down in the regional power-generation lineup. In recent years, it was strictly a bench player.

Ten years ago, the plant ran nearly every day, producing more than three million megawatt hours of electricity, according to PSEG Power. In 2016, Mercer produced a mere 1,867 megawatt hours. Last year, it operated only two days in January, when the regional power-grid operator, PJM Interconnection, called on it to meet high winter demand. The generation station has been inactive for 17 months.

Today, Mercer is a silent industrial castle along the Delaware, its giant blue turbines idle and its 325-foot stacks, ghostly sentries. All the dials on its control-room wall, except for the clock, are pointed at zero.

Three oversized front-end loaders were busy last week reducing a mountain of coal that piled up last year when the plant was on standby — barges kept delivering fuel from a Baltimore terminal under contract. Now, the coal is being loaded back onto barges and resold into the market. Since March, the plant has shipped out 180,000 tons of it.

PSEG said most of the 200 remaining employees at the two plants — more than twice that number worked there during their peaks — have accepted other jobs in the company, which includes the state's largest utility, Public Service Electric and Gas Co. Some employees elected to take buyout packages and retire. Fewer  than 10 employees are still awaiting placement within the company, said Jim Pfennigwerth, 62, the plant manager, who is among those who plan to retire.

Power-generation people are typically not overtly sentimental. Many of those who have worked at Mercer for decades are stoic about the end of an era.

"I actually started here at the lowest levels," said George LaFalce, 61, a 29-year veteran. "Back in the days, I was a plant operator. I ran around and made sure the coal kept moving." He will retire, along with the plant, as its last operations chief.

Mark Schwartzkopf, 66, Mercer's environmental manager, is retiring with 47 years of service at the plant. He takes pride at providing power to the company's customers, especially in the dead of winter. "When it's cold out, you're doing some good," said Schwartzkopf, who commutes to the plant from his home in Haddonfield.

The Mercer and Hudson stations' retirements leave New Jersey with two remaining coal-fired plants, both in South Jersey. The Logan Generating Plant, a 225-megawatt plant on the Delaware near Swedesboro, was built in 1994 and is equipped with modern emission controls.  Chambers Cogeneration LP operates a 261-MW plant in Carneys Point, Salem County.

PSEG Power still operates the Bridgeport Harbor plant in Connecticut, which is scheduled to be retired in 2021 and replaced by a gas plant. It also has ownership stakes in the Keystone and Connemaugh coal plants in Western Pennsylvania, which are built near mines and operate with high efficiency. But it sees no growth in coal.

"We won't be investing in new coal," Izzo said.

At Mercer, PSEG's environmental investments are the main features of the tour. It added precipitators in 1995 to reduce soot emissions, and the first of three units to reduce nitrogen oxides, which contribute to ground-level ozone, or smog. In 2004, it added a $100 million selective catalytic reduction unit to cut nitrogen oxides, and in 2007 a $10 million carbon-injection unit to reduce mercury. In 2010, it spent $500 million to build a baghouse and scrubber to control sulfur, mercury and particulates.

"They're very clean plants  and not because they don't run," Izzo said. The emissions-control features now occupy two times more land on Mercer's 114-acre site than the original power plant.

Izzo and some plant employees expressed concern that the closures of the coal plants will reduce the diversity of fuel sources that power the region, making the electric grid less resilient as natural gas becomes more dominant. It's a theme that is being pounded in Congress and state capitals in the region, particularly by the nuclear industry, which is lobbying for some type of price support for nuclear power plants to reward their clean emissions.

Along with Mercer and Hudson, PSEG has retired other power plants recently without raising alarms, Izzo said, but the potential shutdown of its nuclear plants could have much deeper economic and environmental consequences. "We retired 3,000 MW and didn't say anything," he said. "If we make a fuss, it's because we mean it and it matters."

As for the Mercer and Hudson sites, it is likely they will remain in industrial use. Hudson will be used to store equipment to support other plant operations in the area, Izzo said. Until a long-term plan for Mercer emerges, he said, the company has begun explorations with New Jersey environmental officials about installing solar panels, since the site already has transmission lines connected to the grid.

"We really want to preserve those sites for future power generation," Izzo said. "It's not easy to site power plants."