The Pennsylvania Supreme Court ruled Thursday that a 2012 fracking law allowing gas companies to drill anywhere in the state without regard to local zoning laws is unconstitutional.

The court’s decision called the state’s Marcellus Shale drilling law, Act 13, unconstitutional given restrictions it placed on municipalities’ rights. The ruling also sent back to Commonwealth Court - one of Pennsylvania’s appellate courts - challenges by local townships and individuals to the law’s provisions that barred doctors from passing along to patients the health risks associated with shale drilling, the Pittsburgh Post-Gazette reported.

In the majority opinion, the justices cited Article 1 Section 27 of the Pennsylvania State Constitution, which guarantees the “right to clean air, pure water, and to the preservation of the natural, scenic, historic and esthetic values of the environment.”

“When government acts, the actions must on balance reasonably account for the environment of the affected locale,” wrote the majority, Chief Justice Ronald Castille and Justices Debra McCloskey Todd, Seamus McCaffery and Max Baer.

Dissenting opinions were written by Justices Thomas Saylor and J. Michael Eakin.

Commission President Deron Gabriel of South Fayette, one of the municipalities challenging the law, said the decision preserves local communities’ rights in the face of an unrelenting industry.

“Preserving zoning is vital to local planning efforts, in order to keep industrial activity out of residential and commercial areas,” Gabriel told the Post-Gazette. “Now we can keep industrial activities away from our school and residences, and there’s been more and more of a push by the industry to locate closer to the residential areas.”

John Smith, the attorney who brought the case for South Fayette and other localities, said the decision was, overall, a victory for citizens standing up against the state’s favorable treatment of corporate interests over the rights of the people.

“We got the major thrust of what we were looking for," he said. "The drill-everywhere provision was declared unconstitutional and that part of the law was permanently enjoined.”

Gov. Tom Corbett, who supported and signed the legislation, said he was disappointed by the ruling, maintaining that the provision respected local government rights and environmental concerns.

“The Act was crafted with strong input and support from Pennsylvania’s local government organizations,” he said in a statement. “We must not allow today’s ruling to send a negative message to job creators and families who depend on the energy industry. I will continue to work with members of the House and Senate to ensure that Pennsylvania’s thriving energy industry grows and provides jobs while balancing the interests of local communities.”

The State Department of Environmental Protection, which argued against the challenge and in favor of Act 13, did not issue a comment.

Dave Spigelmyer, president of gas industry lobby group Marcellus Shale Coalition, said drilling companies will review the decision and determine what’s next for fracking in Pennsylvania.

“Although we will continue to collaborate with communities across the Commonwealth, today’s decision is a disappointment and represents a missed opportunity to establish a standard set of rules governing the responsible development and operation of shale gas wells in Pennsylvania,” he said in statement. He went on to stress the need for drilling to improve the state’s economic outlook.

Critics of the law in the state Legislature applauded the ruling for protecting municipal control against energy company power. State Rep. Jesse White (D) added that the decision was an affirmation of the state constitution’s guarantee of “clean air and clean water.”

“[A] clear message has been sent to Governor Corbett and his friends in the energy industry: Our fundamental constitutional principles cannot be auctioned off to wealthy special interests in exchange for campaign dollars. On this day, David has defeated Goliath,” White said.

Hydraulic fracturing, or fracking, is the highly controversial process of injecting water, sand and various chemicals into layers of rock in hopes of releasing oil and gas deep underground.

Pennsylvania is ground zero in the current US fracking boom, with several companies taking advantage of the great reserves contained within the Marcellus Shale region of the state.

Supporters say fracking brings jobs and opportunities for energy independence, though detractors have pointed to exaggerated employment claims, not to mention the health risks related to chemicals used in the practice.

According to a 2010 congressional investigation, Halliburton along with other fracking companies had used 32 million gallons of diesel products, including toxic chemicals such as benzene, toluene, ethylbenzene and xylene. Low levels of exposure to such chemicals can trigger headaches and dizziness, while higher exposure can cause cancer.

In October, researchers found high levels of radioactivity, salts, and metals in water and sediment located downstream from a treatment facility which processes fracking wastewater from oil and gas production sites in Pennsylvania’s Marcellus shale formation.

A new report published this week in the latest edition of the journal Endocrinology shows a dozen chemicals used regularly in fracking are suspected of being endocrine disrupting chemicals, or EDCs — chemicals that can interfere with the human body’s endocrine functions and have been linked to heightened risks of cancer, low fertility rates and decreased sperm quality.

The widespread drilling technique is receiving scrutiny across the US, including places where energy development is commonplace.

Dallas, Texas recently passed new restrictions that bar hydraulic fracturing within 1,500 feet of a home, school, church, and other protected areas. The new rules effectively ban the practice within the city.

In addition, voters in four cities in the state of Colorado recently succeeded in either banning or suspending hydraulic fracturing, despite heavy spending by the oil and gas industry to the tune of $870,000 to defeat the measures.

All four of those measures passed in Colorado will face legal challenges by the fracking industry along with the office of Governor John Hickenlooper, which has expressed the position that the municipalities lack the authority to determine the use of the state’s natural resources.

In August, the 7- and 10-year-old children of a Pennsylvania couple that reached a settlement following a lawsuit involving health issues brought on by fracking were barred from discussing details of the case for the rest of their lives.

The Pennsylvania family reached a $750,000 settlement with the gas companies, and have used the award to relocate. In exchange, however, Chris and Stephanie Hallowich agreed that no member of their family could comment on the case “in any fashion whatsoever.”