Justice Phillip R. Rumsey of the New York Supreme Court -- the trial-level court in the state -- ruled in favor of the town of Dryden, The New York Times reported. Dryden, a town of about 14,000 people in south-central New York, banned drilling in August.
Dryden's action was challenged by Anschutz Exploration Corp., a Colorado firm that had leased 22,000 acres in the town.
A process of extracting natural gas, known as fracking, has split many local communities. For some property owners, the fees paid by exploration companies are a boon, but critics of the process say the practice has harmful side-effects, including water pollution.
Katherine Nadeau, the water and natural resources program director for Environmental Advocates of New York, said she expects "dozens if not hundreds" of towns in the state to follow Dryden's lead.
"The communities targeted for drilling need the power to determine for themselves when, where and if fracking is permitted," she said in a statement.