ALBANY — National Grid will lift its moratorium on hooking up new gas customers on Long Island and New York City immediately and pay up to $36 million in penalties, Gov. Andrew Cuomo’s office announced Monday.

Grid shareholders will pay about $7 million to compensate customers who couldn’t get service, roughly $8 million for new gas efficiency measures and about $20 million to invest in clean energy businesses across New York, under an agreement between the state and the company. The company will also pay for an independent monitor to oversee its downstate gas operations.

“This agreement is a victory for customers,” Cuomo said in a statement. “National Grid will pay a significant penalty for its failure to address the supply issue, its abuse of its customers, and the adverse economic impact they have caused. The Company is also working to address the long-term supply problem.”

National Grid will increase its energy efficiency programs, demand response — where customers curtail gas use or switch to oil when demand is high — and boost the amount of trucked-in compressed natural gas to serve new customers over the next two years. The company stopped processing applications for firm gas hookups in May when the Cuomo administration denied a key permit for the Williams pipeline to supply Long Island.

The utility will begin processing 4,000 pending applications representing more than 20,000 commercial, residential and multifamily units. All outstanding customers seeking service will have the option to be connected to the gas network, although Grid plans to prioritize residential customers needing heat, critical facilities and new businesses over oil-to-gas conversions.

“It is terrific news for the Long Island economy that the moratorium is being lifted and important projects can move forward again and thus we commend the Governor and National Grid for resolving this short term crisis and encourage all stakeholders to plan for a longer term solution to meet the region’s natural gas needs,” said Long Island Association’s Kevin Law in a statement.

The moratorium blindsided local officials, residents doing renovations and businesses moving into new locations who were left without access to an affordable energy source. Cuomo harshly criticized the company and the PSC for not looking at alternatives to a new pipeline but acknowledged a long-term supply problem for gas downstate.

The new agreement, which involves a memorandum of understanding between the company and the state, will resolve an order to show cause for penalties over the moratorium issued by the PSC in October, according to the governor’s office. The full commission will presumably have to approve the settlement of that outstanding order.

National Grid New York President John Bruckner told POLITICO the company would file details of its short-term plan to supply customers in the next two years within a week to the PSC. The bulk of the freed-up gas supply is expected to come from large industrial customers agreeing to switch to oil or other fuels when demand is high and added trucked supplies.

Bruckner said the reason the utility feels it can safely promise long-term, guaranteed year-round supply to new customers is because the state has agreed to work with the company on the long-term supply problem.

“You have to have a long term supply to make a commitment to customers,” he said. “I can’t connect that customer this year not knowing how I’m going to supply them next year, that customer could be a customer that invested in a plant or materials … and then next year to be told [gas is] not available — that’s not acceptable.”

National Grid will work on identifying options for long-term solutions to the gas supply crunch, which has been driven by economic growth and customers switching from dirtier and more expensive fossil fuels. The company will present options within three months to customers on Long Island and in Brooklyn and Queens to allow for community input, according to the governor’s office.

“There’s a commitment that that decision will be made by next June, and it’s that backstop that enables in the short term to run the risk and not at all put at risk the integrity of the system because we know there’s a backstop to this,” Bruckner said.

The options to be considered include a new pipeline; more trucked-in, compressed natural gas or liquefied natural gas; renewables; conservation strategies; and systems that can switch between oil and gas. A solution will be agreed to with the state by June 2020 and is expected to be online within two years.

The Department of Environmental Conservation has a May 2020 deadline to act again on permits for the Williams pipeline.

“Long term we have a supply issue, especially on Long Island, for natural gas, there’s no doubt about that. And we have to find different ways to bring in gas — do we pipe it in, et cetera, do we go to other forms of energy?” said Cuomo in a radio interview on 1010 WINS on Monday. “But, that’s a discussion to be had and not with a gun to the head of New Yorkers.”

Reaching an agreement on a long-term solution could prove challenging with a backdrop of staunch environmental opposition to any new gas usage or supply measures. Food and Water Watch, which opposes the Williams pipeline to supply Long Island, said ending the moratorium should not involve fossil fuels, although that’s exactly what Grid’s plan entails.

“Cuomo must demand a solution that relies on efficiency, renewables and the electrification of heating systems — not simply finding new, dangerous ways to move fracked gas around,” Food and Water Action organizer Laura Shindell said in a statement. “If Cuomo is serious about the climate goals he just signed into law, it’s time for him to realize fracked gas isn’t part of the solution.”

The Natural Resources Defense Council, which has also opposes the pipeline, called for Cuomo to ensure that project doesn’t get built.

“The agreement is a massive relief to the thousands of New Yorkers unfairly harmed by a ploy to build more fossil fuel infrastructure,” said senior attorney Kim Ong. “Moving forward with the Williams Pipeline would be a total contradiction of our climate goals and jeopardize the health of marine life and communities across the state. Governor Cuomo must hold firm and shelve this reckless project once and for all.”

The $20 million clean energy fund which is part of the financial penalty Grid will pay, will be administered by the Division of the Budget and the Public Service Commission, according to the governor’s office. Details of what the funds can be used for were not immediately provided.

The total cost to ratepayers for increasing energy efficiency, demand response programs and compressed natural gas supplies is also not clear. National Grid may seek to recover additional costs from customers through its outstanding rate increase request, where negotiations have been on hold amid the fight over the moratorium.

Incentives for large commercial and industrial customers to reduce gas usage on the coldest winter days by switching fuels, thus allowing Grid to serve more customers, will be paid for by National Grid shareholders — the $8 million for gas efficiency measures, according to Bruckner. The supply costs of additional trucked-in CNG will be passed on through commodity prices to ratepayers, he said.