New York's top state court held Monday that towns have the authority to ban drilling for gas, giving a boost to opponents of the controversial method known as fracking.

The Court of Appeals in a 5-2 decision upheld bans in the Ithaca suburb of Dryden and in Middlefield, near Cooperstown, saying the laws were extensions of the towns' zoning authority. Town are allowed to ban fracking — hydraulic fracturing — only within their borders.

The appeal ruling comes after drilling company Norse Energy USA and an upstate dairy farmer separately sued the towns, claiming the bans violated a law designed to create uniform statewide regulations on the oil and gas industry. The New York State Oil, Gas and Solution Mining Law bars local governments from regulating the industry in most cases.

But the court disagreed, saying the law was designed to bar only local ordinances that could impede the state's ability to regulate drilling activities.

"Plainly, the zoning laws in these cases are directed at regulating land use generally and do not attempt to govern the details, procedures or operations of the oil and gas industries," Judge Victoria Graffeo wrote for the court.

The decision affirmed rulings by three lower courts.

Similar lawsuits have been brought against cities in other states after attempts to ban fracking. Last year the Colorado towns of Lafayette and Fort Collins voted to ban shale gas extraction. In December the Colorado Oil and Gas Association — the agency responsible for overseeing the state’s oil and gas activities — sued, saying the bans went against a ruling by the state’s Supreme Court that said such development supersedes local law and may not be banned.

Lafayette and Fort Collins went ahead with their bans despite a precedent set by the 1992 case of Voss v. Lundvall Bros. Inc., which overturned a voter-approved ban on drilling oil and gas wells in Greeley, Colorado. In its decision, the Colorado Supreme Court said that bans cannot pre-empt the Oil and Gas Conversation Act, which ensures development of mineral resources.

The energy industry has argued that such a ban would violate residents' constitutional rights to develop mineral resources on their land.

Other recent bans on fracking include the city of Los Angeles and the county of Santa Cruz in California. Denton, a heavily drilled Texas town, will vote on a ban in November.

In New York state, Dryden and Middlefield in 2011 were among the first of more than 170 municipalities to ban gas drilling as state officials considered whether to lift a moratorium on fracking, which is still in place. Hydraulic fracturing has been stalled in the state for over five years as leaders investigate possible environmental and health effects of the practice.

Fracking involves blasting chemical-laced water and sand deep belowground to release oil and natural gas trapped within rock formations. It has allowed companies to tap a wealth of new natural gas reserves in other states, but critics say the procedure pollutes the water and air and has caused seismic activity near wells.

Seismologists have concluded that fracking can lead to small earthquakes, but now researchers are focused on fracking wastewater disposal. Leftover water from the fracking process is sequestered underground, and some scientists believe the liquid lubricates faults, possibly triggering quakes tens of miles away.

Some researchers have hypothesized that the usually small quakes suspected as linked to wastewater disposal — about 3.0 to 4.0 on the Richter scale — could become larger over time as more wastewater is sequestered.

Officials from Dryden and their attorneys praised the decision. "Today's ruling shows all of America that a committed group of citizens and public officials can stand together against fearful odds and successfully defend their homes, their way of life and the environment against those who would harm them all in the name of profit," Dryden Deputy Supervisor Jason Leifer said in a statement.

Thomas West and Scott Kurkoski, who represented the plaintiffs in both cases, did not immediately return requests for comment.

In dissent, Judge Eugene Pigott said the towns' bans went beyond their zoning authority because they include detailed language about drilling activities, such as the storage of gas and use of drilling equipment. The bans "do more than just regulate land use; they regulate oil, gas and solution mining industries under the pretext of zoning," he wrote, joined by Judge Robert Smith.

Al Jazeera and wire services