The U.S. Supreme Court on Monday ruled in favor of BP PLC, Chevron Corp., Exxon Mobil Corp., Royal Dutch Shell PLC and other energy companies contesting a lawsuit filed by the city of Baltimore seeking monetary damages from them due to costs caused by global climate change.

The 7-1 ruling, authored by conservative Justice Neil Gorsuch, came on a technical legal issue that could help the companies in their effort to have the case heard in federal court, as they would prefer, instead of state court, which the city favors as it is seen as a more amenable venue.

The high court decided that the Richmond, Virginia-based 4th U.S. Circuit Court of Appeals did not correctly analyze whether the case could be heard in federal court.

The Democratic-governed Maryland city’s lawsuit targeted 21 U.S. and foreign energy companies that extract, produce, distribute or sell fossil fuels, arguing that their activities contribute to emissions of carbon dioxide and other so-called greenhouse gases linked to climate change. An important port city, Baltimore noted that it is vulnerable to sea-level rise and flooding driven by climate change.

The Supreme Court’s ruling could affect around a dozen similar lawsuits brought by various U.S. states, cities and counties.

Liberal Justice Sonia Sotomayor dissented in the ruling. Conservative Justice Samuel Alito, did not participate in the case, likely because he owns stocks in two oil companies involved in the litigation.

The legal question concerned a provision of U.S. law that puts limits on appeals courts reviewing decisions by federal district court judges to remand a case to state court. The companies have said that in this instance the 4th Circuit had broad scope to review a district court’s decision because of a provision that permits appeals of such rulings when a case directly concerns federal officials or government entities.

The energy companies have argued that energy production is an inherently federal issue, meaning the case should be heard in federal court.

Greenhouse gas emissions that cross state and international lines are likewise an issue that cannot be addressed under state laws, the companies added.

With Congress long divided over action on combating climate change, the lawsuits represent an effort to force action through litigation rather than legislation.