This ICN story was also published in the Boston Globe.

A federal judge has ruled that the coastal city of South Portland, Maine, did not violate the U.S. Constitution when it passed an ordinance that blocked a local pipeline company from bringing tar sands oil through its port.

For the city of 25,000, the ruling was a surprise victory after years of fighting what felt like an impossible battle against some of the world's biggest oil companies, which lined up to support the Portland Pipe Line Corporation (PPLC).

Provided the ruling survives an appeal, it slams the door on a significant plan to ship Canadian tar sands oil, one of the most carbon-intensive fuels on the planet, to the East Coast for export to international markets, and it could offer a guide for other communities hoping to block energy projects.

"For other communities looking at opposing fossil fuel infrastructure, this case is a blueprint for how you should do it," said Patrick Parenteau, an environmental law professor at the Vermont Law School. "It's a strong opinion, and it could result in a really significant precedent for local control on petroleum-based industries."

Sign up for InsideClimate News Weekly Our stories. Your inbox. Every weekend.

The pipeline company's plan involved a 70-year-old pipeline system that currently carries conventional crude oil in the opposite direction, from a tanker facility in South Portland to refineries in Montreal. After Canada's tar sands oil boom crippled the market for oil travelling from Maine to Montreal, PPLC saw its business dwindle.

A plan to reverse the flow and provide a route for tar sands oil to reach global markets through the port at South Portland represented a golden egg for the company—a way to redefine its business model, provide jobs and become a linchpin for oil exports.

But it also would have come at a steep price, the grassroots group Protect South Portland argued.

The plan called for the construction of a pair of 70-foot-high smokestacks next to a beloved waterfront park to burn off volatile compounds from the tar sands oil before it could be loaded into tankers. Concerns about emissions from those smokestacks led to the creation of the so-called Clear Skies Ordinance, which banned the bulk loading of crude oil onto tankers.

When the City Council passed the ordinance in 2014, it sought to protect South Portland citizens from air pollution. The ordinance's foundation lay in Maine's "home rule authority," a stipulation of the state Constitution that allows municipalities to create regulations that go beyond state rules to protect public health and welfare.

The pipeline company filed its lawsuit in 2015, and a lengthy, expensive legal battle ensued. Late last year, a federal district court judge threw out all but one of the industry's claims against the city, but left open the key question of whether the ordinance violated the Constitution.

In his 92-page decision issued on Friday, Judge John A Woodcock, Jr., found it did not.

The decision "gives communities a powerful tool," said Ken Rumelt, a Vermont Law School professor who led students at its environmental law clinic in advising groups involved in the case. "It says that a community, assuming there is no state law preempting what they're trying to do, can say no, we don't want to suffer these impacts."

A Tale of Two Portlands

The Maine decision echoes one issued earlier this month in the other Portland—Oregon.

There, a group of industry and business groups had sued over a 2016 ordinance that banned the construction of new fossil fuel infrastructure. As in Maine, the petitioners argued that the ordinance violated the Commerce Clause of the Constitution, which regulates commerce with foreign nations, among states and with Native American tribes.

After years of volleying through the courts, the Oregon Supreme Court opted not to hear a challenge to the ordinance.

"The two Portlands are setting the stage for lots of other communities in between the two coasts," said Sean Mahoney of the Conservation Law Foundation, who has advised South Portland. "The lesson is that communities have the right and the obligation to protect the public health of the people who live in them, whether that is from air pollution or water pollution or lead in drinking water or housing."

As Goes Maine?

In the Maine case, the local pipeline company enlisted powerful allies as it opposed the ordinance. The American Petroleum Institute, whose members include most major oil and gas companies, spent hundreds of thousands of dollars to defeat a 2013 ballot measure that would have blocked the project. After the ordinance was passed, API and the U.S. Chamber of Commerce both supported PPLC in its lawsuit.

Josh Axelrod, a policy analyst with Natural Resources Defense Council, said that support laid bare just how much the industry wanted to use the PPLC pipelines to gain access to the East Coast for exporting tar sands. "This is a huge win to stop that from happening," he said.

One by one, viable options to export the tar sands via pipeline have run into challenges. TransCanada abandoned its plans for the Energy East Pipeline in 2017, announcing it was uneconomical. Earlier this month, a federal judge ordered a new environmental review of the Keystone XL project. And later this week, a Canadian court will rule on whether First Nations groups were adequately consulted in the plans for the Trans Mountain pipeline—a decision that could delay or cancel the plans for that pipeline.

These challenges "put some upper limit on where the industry would like to go," Axelrod said. "Back almost 10 years ago, they would talk about growing to 9 million barrels of oil per day of [tar sands] production. Their most optimistic projections now are less than 4.5 million barrels of oil per day."

And that's premised on the construction of at least two new pipelines, Axelrod said—a prospect that's seeming less likely given the opposition and court rulings.

'Committed Citizens Can Change the World'

The South Portland case will most likely be appealed. But for now, the decision is being met with surprise, and relief.

Mayor Linda Cohen praised the ruling in a written statement, saying, "Faced with the prospect of hundreds of thousands of barrels of crude oil being loaded onto marine tank vessels in the City and threatening the health of the residents and preventing redevelopment of the waterfront, the City Council prohibited this new activity. We are pleased that the Court upheld the ordinance."

Rachel Burger, the co-founder and president of Protect South Portland, said she was overjoyed. "I didn't count on this happening, necessarily. I thought the ruling was more likely to be negative," she said. "I'm just amazed that a group of people can do something like this."

Thinking back on years of canvassing, fundraisers, marches and grassroots organizing, Burger said she keeps coming back to a Margaret Mead quote: "Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it's the only thing that ever has."