Oregon’s Supreme Court has handed a major victory to Portland, upholding the city’s right to greatly restrict fossil fuel infrastructure. The measure has been a source of controversy and considerable back-and-forth over the past few years as business groups have sought to challenge the ordinance.

On Tuesday, the court declined to review a Oregon Court of Appeals decision issued in January that affirmed Portland’s constitutional right to prohibit new fossil fuel infrastructure, including storage and distribution terminals for oil and gas.

In 2016, the Portland City Council unanimously approved the ordinance limiting the construction of such terminals. This lead business groups to appeal the issue to Oregon’s Land Use Board of Appeals (LUBA). The Columbia Pacific Building Trades Council, Portland Business Alliance and Western States Petroleum Association have led the opposition to the city’s efforts.

LUBA ruled that Portland had violated the Commerce Clause of the U.S. Constitution in that it restricted interstate commerce, a decision that was later overturned by the Court of Appeals. Tuesday’s decision by the state Supreme Court upholds that ruling, finding that Portland’s ordinance is not unconstitutional after all.

But the Appeals Court decision in January upheld parts of LUBA’s earlier ruling, meaning that Portland will have to reimplement the ordinance in light of the Supreme Court’s move in order for it to go into effect. Once the ordinance is implemented, it will mark one of the strongest resolutions against fossil fuels in the country.

Environmentalists and sustainability advocates hailed the news. Oregon Physicians for Social Responsibility, Audubon Society of Portland, the Center for Sustainable Economy, and Columbia Riverkeeper had all fought to allow Portland’s ordinance against fossil fuel infrastructure to move forward.

“We’re thrilled. The courts have affirmed that Portland and other communities can implement innovative protections to counter threats to human health and safety from dangerous fossil fuel infrastructure,” said Regna Merritt of Oregon Physicians for Social Responsibility in a statement.

The ordinance restricts the size of existing terminals and prohibits new terminals with a capacity exceeding 2 million gallons. Around 11 terminals in Portland will be significantly impacted by the ordinance, all in the city’s Northwest industrial district and storing much of the natural gas powering both Oregon and part of Washington. Owners of those terminals include energy giants Shell, BP, Kinder Morgan, Chevron, Phillips 66, and NW Natural, according to the Portland Tribune.

Portland’s ordinance has been hailed by climate activists as groundbreaking in a coastal state threatened by climate change. Like much of the West Coast, Oregon appeals to fossil fuel companies thanks to its ports and rail routes, which allow for the shipment of U.S. oil and coal to overseas markets. But the region is plagued by sea level rise linked to global warming, in addition to other growing environmental hazards exacerbated by climate change.

That reality has spurred communities across the Pacific Northwest to form a “green wall of resistance” in the fight against climate change, with cities like Portland working to pass legislation with an eye on sustainability. While the city is still intertwined with fossil fuels in many ways — including reliance on gas-powered cars — it still has control over zoning codes and land use, allowing for the ordinance’s formation in 2015 and passage a year later.

While the ordinance’s supporters faced an uphill battle since then, advocates say Portland’s victory on Tuesday will send a critical message to other cities.

“This is an important signal to other local governments that they can protect their residents from the many dangers of the fossil fuel industry,” said Nicholas Caleb, who serves as staff attorney for the Center for Sustainable Economy. “This precedent will allow much greater creativity from cities and counties that want to create safe, healthy, and sustainable communities for their residents.”