HARRISBURG, Pa. — Pennsylvania’s highest court on Wednesday blocked industry-friendly provisions of a major 2012 state law designed to modernize natural gas drilling regulations, the latest in a string of court decisions striking down key portions of the law.

Four of the court’s six participating justices agreed in an 88-page decision stripping out provisions that a lawyer for a handful of municipalities described as “gifts” to the ascendant gas industry given amid the Marcellus Shale natural gas drilling boom.

“It generally was, in a lot of respects, an unconstitutional special law,” said lawyer Jordan Yeager. “It was carving out a unique set of benefits for the gas drilling industry that no other industry enjoyed. … Our constitution says you can’t do that.”

For the most part, the law’s provisions being challenged in court had been unused. But Yeager said the threat had remained that a municipality could be punished financially by state utility regulators if a gas drilling company complained that it had enacted an ordinance that was stricter than state law.

This decision will give those municipalities “breathing room” to enact tougher ordinances on the natural gas industry, Yeager said.

The Marcellus Shale Coalition, a natural gas exploration industry trade group, warned of the economic consequences of the decision.

“We’re disappointed in aspects of the court’s ruling, which will make investing and growing jobs in the commonwealth more — not less — difficult without realizing any environmental or public safety benefits,” the organization’s president, David Spigelmyer, said in a statement.

The plaintiffs included several townships in heavily drilled southwestern Pennsylvania — Peters, Cecil and Mount Pleasant in Washington County, and Robinson and South Fayette in Allegheny County — and Nockamixon Township and Yardley Borough in southeastern Pennsylvania’s Bucks County, where officials had been worried about their inability to control future natural gas exploration.

The lawsuit was filed in 2012, weeks after the legislation passed the Republican-controlled Legislature and was signed by then-Gov. Tom Corbett, a Republican.

In late 2013, the Supreme Court struck down perhaps the most controversial aspect: provisions that limited the power of local governments to determine where the industry can operate. The industry had sought the rules as one of its top priorities in Pennsylvania.

Then in 2014, a lower court blocked a related provision that had allowed state utility regulators to review how local zoning restrictions affect the natural gas industry, and punish municipalities whose restrictions were more stringent than the state’s.

On Wednesday, the high court upheld the lower court’s 2014 ruling, but went farther, in striking down two other elements. One was essentially a 1980s-era law effectively reprinted in the 2012 law that the justices say amounts to illegal eminent domain for a private purpose, natural gas storage.

Also struck down were provisions referred to as the “medical gag rule.”

Those provisions required drilling or service companies to disclose the proprietary content of hydraulic fracturing solutions to doctors who may have been treating patients who came into contact with, but it allowed the companies to require doctors to agree to keep the information confidential.

The ruling did not appear to leave intact any requirement for the companies to disclose proprietary information to health professionals.