ALBANY, N.Y. (AP) — A state judge invalidated Binghamton's two-year moratorium on natural gas drilling, marking the first time a local law that would ban or delay hydraulic fracturing in New York has been struck down.

State Supreme Court Justice Ferris D. Lebous became the latest New York judge to weigh in on local bans or moratoriums Tuesday, ruling that the city law approved December 2011 failed to meet the standards of a properly enacted moratorium. Lebous said the city never established that there was a "dire emergency" regarding a practice that is still not allowed in New York.

"There can be no showing of dire need since the New York state Department of Environmental Conservation has not published the new regulations that are required before any natural gas exploration or drilling can occur in this state," Lebous wrote.

Gov. Andrew Cuomo's administration is considering whether to allow natural gas drilling using hydraulic fracturing, or fracking, a process involving the injection of wells with chemically treated water that is denounced by many environmentalists.

As the DEC review continues, more than 30 upstate municipalities have passed bans on gas drilling and more than 80 have enacted moratoriums. The laws enacted by towns sitting atop the gas-rich Marcellus Shale formation are typically in response to fears that fracking could contaminate water supplies, though the energy industry says the process has been used safely for years.

Local bans in Dryden and Middlefield have already passed muster with state courts. Lebous referred to those two previous court decisions as "well-reasoned" and focused his decision on Binghamton's actions. Despite the loss for Binghamton, about 130 miles southwest of Albany, environmentalists said the ruling reaffirms the legal right for local bans. Lawyers for environmental groups said they don't believe this ruling would imperil the other local bans.

"Almost all of the decision is very fact specific and limited to Binghamton, which had a very unique law," said Helen Slottje, an attorney with the Community Environmental Defense Council, which represented the city.

Binghamton Mayor Matthew Ryan said Wednesday an appeal is likely. He said the city could try to pass a similar law that would not run afoul of the court.

City officials had argued the law was not a moratorium but an emergency action to protect its water. But Lebous ruled it was a moratorium and held the city to that strict legal standard.

The lawsuit was bought by a group of plaintiffs who claimed the law could harm their business or prevent them from obtaining natural gas leases.

"You've got to follow the letter of the law," said Kenneth S. Kamlet, a lawyer for the plaintiffs. "The city of Binghamton didn't play by the rules, and they had to pay the piper."

Also on HuffPost:

Loading Slideshow...
  • In this file photo from Oct. 14, 2011, a drilling rig is seen in Springville, Pa. State regulators blamed faulty gas wells drilled for leaking methane into the groundwater in nearby Dimock, Pa. It was the first serious case of methane migration said to be related to the Pennsylvania Marcellus Shale gas field drilling boom. (AP Photo/Alex Brandon, FILE)

  • British police secure the area where demonstrators erected a mock fracking rig with a banner reading 'No fracking in the UK' in a protest against hydraulic fracturing for shale gas outside the Houses of Parliament in London on December 1, 2012. AFP PHOTO / JUSTIN TALLIS

  • SPRINGVILLE, PA - JANUARY 18: A truck with the natural gas industry, one of thousands that pass through the area daily, drives through the countryside to a hydraulic fracturing site on January 18, 2012 in Springville, Pennsylvania. (Photo by Spencer Platt/Getty Images)

  • SAN FRANCISCO, CA - MAY 30: Protestors stage a demonstration against fracking in California outside of the Hiram W. Johnson State Office Building on May 30, 2013 in San Francisco, California. Dozens of protesters with the group Californians Against Fracking staged a protest outside of California Gov. Jerry Brown's San Francisco offices demanding that Gov. Brown ban fracking in the state. (Photo by Justin Sullivan/Getty Images)

  • People demonstrate on August 3, 2013 in La Petite Brosse, near Jouarre, outside Paris, to protest against an exploratory oil shale drilling, considering that it opens the door to the exploration of shale gas in the Parisian Basin. Banner reads 'Stop gas and oil shale'. AFP PHOTO / PIERRE ANDRIEU

  • In this Nov. 26, 2012 photo, Steve Lipsky demonstrates how his well water ignites when he puts a flame to the flowing well spigot outside his family's home in rural Parker County near Weatherford, Texas. The U.S. Environmental Protection Agency had evidence a gas company's drilling operation contaminated Lipsky's drinking water with explosive methane, and possibly cancer-causing chemicals, but withdrew its enforcement action, leaving the family with no useable water supply, according to a report obtained by The Associated Press. The EPA's decision to roll back its initial claim that hydraulic fracturing, or “fracking,” operations had contaminated the water is the latest case in which the federal agency initially linked drilling to water contamination and then softened its position, drawing criticism from Republicans and industry officials who insisted they proved the agency was inefficient and too quick to draw conclusions. (AP Photo/LM Otero)

  • In this file photo of Jan. 17, 2013, Yoko Ono, left, and her son Sean Lennon visit a fracking site in Franklin Forks, Pa., during a bus tour of natural-gas drilling sites in northeastern Pennsylvania. Ono and Lennon have formed a group called “Artists Against Fracking,” which has become the main celebrity driven anti-fracking organization. (AP Photo/Richard Drew, File)

  • In this March 29, 2013 file photo, a worker checks a dipstick to check water levels and temperatures in a series of tanks at a hydraulic fracturing operation at a gas drilling site outside Rifle, Colorado. (AP Photo/Brennan Linsley)

  • In this March 29, 2013 file photo, a worker switches well heads during a short pause in the water pumping phase, at the site of a natural gas hydraulic fracturing and extraction operation outside Rifle, in western Colorado. (AP Photo/Brennan Linsley)

  • In this March 29, 2013 file photo, workers tend to a well head during a hydraulic fracturing operation at a gas well outside Rifle, in western Colorado. (AP Photo/Brennan Linsley)

  • Josh Fox, director of the anti-fracking, Oscar-nominated documentary “Gasland” testifies during a House Committee hearing on oil drilling, "fracking" legislation at the Illinois State Capitol Tuesday, May 21, 2013, in Springfield, Ill. (AP Photo/Seth Perlman)

  • This is a Thursday Aug. 15, 2013 image of the Cuadrilla exploration drilling site in Balcombe, southeast England. (AP Photo/Gareth Fuller/PA)

  • A child plays near a farmers' protest in an area where oil company Chevron plans to put a drilling rig exploring for shale gas in the south-eastern Polish village of Zurawlow on June 11, 2013. AFP PHOTO / JANEK SKARZYNSKI

  • Protesters hold a banner during a protest outside of the Momentive resin plant, Monday, July 8, 2013, in Morganton, N.C. Dozens of environmental activists blocked a chemical plant Monday to protest against the company's sale of products used in the natural gas drilling process called hydraulic fracturing, or fracking. (AP Photo/The News Herald, Mary Elizabeth Robertson)

  • A fracking rig exploring for shale gas of oil company Chevron on June 11, 2013 in a village of Ksiezomierz in south-eastern Poland. AFP PHOTO / JANEK SKARZYNSKI

  • People demonstrate on August 3, 2013 in La Petite Brosse, near Jouarre, outside Paris, to protest against an exploratory oil shale drilling, considering that it opens the door to the exploration of shale gas in the Parisian Basin. AFP PHOTO / PIERRE ANDRIEU

  • Opponents of hydraulic fracturing in New York state attend a news conference and rally against hydraulic fracturing, also known as fracking, on January 11, 2012 in New York City. (Photo by Spencer Platt/Getty Images)

  • Eric Weltman of Food & Water Watch attends a news conference and rally against hydraulic fracturing, also known as fracking, in New York State on January 11, 2012 in New York City. (Photo by Spencer Platt/Getty Images)

  • Opponents and supporters of gas-drilling, or fracking, walk into the last of four public hearings on proposed fracking regulations in upstate New York on November 30, 2011 in New York City. (Photo by Spencer Platt/Getty Images)

  • Engineers on the drilling platform of the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • Engineers at work on the drilling platform of the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • General views of the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • Engineers look at the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • A lump of shale rock on display at the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • Engineers on the drilling platform of the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • Engineers at work on the drilling platform of the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • Drill heads on display at the entrance to the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • An engineer displays a lump of shale rock at the Cuadrilla shale fracking facility on October 7, 2012 in Preston, Lancashire. (Photo by Matthew Lloyd/Getty Images)

  • Actor/director Mark Ruffalo (C) speaks at the Hydraulic Fracturing prevention press conference urging the protection of the drinking water source of 15 million Americans at Foley Square on April 25, 2011 in New York City. (Photo by D Dipasupil/Getty Images)

  • (L-R) Actor/director Mark Ruffalo, Denise Katzman, Wenonah Hauter, and Water Defense co-founder/campaign director Claire Sandberg attend the Hydraulic Fracturing prevention press conference urging the protection of the drinking water source of 15 million Americans at Foley Square on April 25, 2011 in New York City. (Photo by D Dipasupil/Getty Images)