The coal-fired power plant in Dunkirk officially won a two-year reprieve from a threatened shutdown Wednesday, under an agreement that will keep the facility operating at a reduced capacity through May 2015.

The plant’s owner, NRG Energy, and National Grid have signed the agreement that will keep one 80-megawatt unit operating at the Dunkirk plant in order to maintain the reliability of the region’s electricity supply while more extensive studies are done to determine whether the power plant is needed in the long term.

A second unit now operating will be shut down, resulting in the loss of about 14 jobs at the plant, which employs 82 people. Most of the positions will be eliminated through transfers, attrition or retirements, said David Gaier, an NRG spokesman.

“This will keep the station open for two years,” Gaier said. “It’s good news.”

NRG filed a notice with regulators in March 2012 to mothball the Dunkirk plant, which has a generating capacity of 520 megawatts, because low prices for natural gas and an ample supply of power plants across New York have depressed electricity prices and led to steep losses at the facility.

The Dunkirk plant lost about $73 million during the 12 months that ended in February 2012, according to a filing the company made with the Federal Energy Regulatory Commission.

NRG mothballed two of the Dunkirk plant’s biggest generating units last year, and the agreement filed this week will result in the mothballing of a third unit, with a generating capacity of 80 megawatts, after the end of May. At that point, the Dunkirk plant will have only one generating unit in operation.

The agreement is the result of a continuing study of the impact that mothballing the Dunkirk plant would have on the region’s electricity supply. National Grid already has made some initial improvements to its electricity transmission and distribution network, which will allow the Dunkirk plant to drop to a single operating unit this spring.

National Grid last month completed a review that determined it would need to make $60 million to $70 million in improvements to its transmission lines and equipment to compensate for the loss of the Dunkirk plant.

NRG, which has proposed an ambitious $714 million project to switch the Dunkirk plant and the Huntley Station in the Town of Tonawanda into facilities that can run on natural gas, currently is preparing a report, due March 19, on the costs associated with repowering the Dunkirk facility.

Once the NRG report is filed, National Grid then will have 30 days to evaluate the transmission and repowering options.

Under the terms of the agreement, National Grid will pay NRG up to $72.7 million to operate the generating unit. The utility agreed to pay nearly $51 million for the power it generates through May 2015, in addition to $13.1 million for property taxes at the plant and $8.7 million more in potential coal transportation charges.