The B.C. government is vowing to appeal a Court of Appeal decision that said it doesn’t have the right to regulate heavy oil or diluted bitumen flowing through a federal pipeline.

The province believes it does have the right to take steps to protect the land and coast from a catastrophic oil spill, said B.C. Attorney General David Eby, even though a unanimous panel of five judges rejected the arguments in favour of the national interest.

"This is something we think could be clarified by the Supreme Court of Canada," Eby told a gathering of reporters in Vancouver.

"The aim of this regulation is to protect British Columbia’s coast and our environment from the catastrophic effects of a diluted bitumen spill. We believe we have the right and the authority constitutionally to regulate harmful substances that are brought into British Columbia, however they get here."

B.C.’s premier, speaking at an event in Kelowna, B.C., also told reporters the Supreme Court could be the next stop in the dispute.

"I’m confident we have the jurisdiction. The Court of Appeal disagreed. There are other courts, higher courts, that we will likely appeal to, but I will leave that decision with the Attorney-General," John Horgan said.

Friday's decision is a setback for environmental groups and some First Nations groups that had hoped to use environmental protections to restrict the amount of heavy oil flowing through a twinned Trans Mountain pipeline.

Such a provincial law could "stop in its tracks" oil flowing from Alberta to B.C.’s coast, and "usurp" federal government jurisdiction in a project that needs to be decided in the interests of the whole country, wrote Madam Justice Mary Newbury for a five-member panel.

"At the end of the day, the [National Energy Board] is the body entrusted with regulating the flow of energy resources across Canada to export markets…the Trans Mountain pipeline is not only a British Columbia project. The project affects the country as a whole, and falls to be regulated taking into account the interests of the country as a whole," she wrote.

The Trans Mountain pipeline, which is now owned by a federal Crown corporation, runs 1,150 km from just outside Edmonton, Alberta, to Burnaby, B.C. It proposes to twin the pipeline, roughly tripling its capacity to 890,000 barrels a day. That would increase tanker traffic seven fold.

"This reference is not about whether the planned Trans Mountain pipeline expansion (TMX) should be regulated to minimize the risks posed to the environment – that is a given," Newbury wrote. She found all of that is already regulated by the National Energy Board.

"There is in place a complex web of federal statutes and regulations that apply to all aspects of interprovincial pipelines, including environmental assessment, operational oversight, spill and accident responses, and financial liability and compensation for harm done by spills."

B.C. had asked the court to decide whether it was within the province’s jurisdiction to change the Environmental Management Act to regulate the substances within the pipeline.

The purpose behind the legislation was to prohibit anyone from having control of a "hazardous substance" above a 2017 baseline amount, without a provincial permit.

Their argument: both the province and the federal government have a constitutional right to protect the environment, and any oil spill would disproportionately affect British Columbians and the coast.

But the court found that the pipeline is an "interprovincial work" and is the responsibility of the federal government to regulate under Canada’s constitution.

The judge stressed that Canada’s constitution evolves and can accommodate multiple levels of governments’ laws operating together. The new provincial rules might have been found constitutional if they had not directly impacted something so clearly up to Ottawa to regulate.

"Even if it were not intended to 'single out' the TMX pipeline, it has the potential to affect (and indeed ‘stop in its tracks’) the entire operation of Trans Mountain as an interprovincial carrier and exporter of oil," Justice Newbury wrote.

"It is legislation that in pith and substance relates to, and relates only to, what makes the pipeline 'specifically of federal jurisdiction.'"

It also asked two other questions that, since the court ruled the first question was out of the province’s jurisdiction, the court didn’t consider.

The National Energy Board’s previous approval of the twinning of the Trans Mountain pipeline was overturned by the Federal Court of Appeal, on the grounds that the previous approval didn’t consider the effects of an oil spill on B.C.’s coast.

That prompted the previous owner, Kinder Morgan, to walk away. The federal government spent $4.5 billion buying the pipeline, saying it was in the national interest, and re-applied to the NEB. In February, the NEB made 16 new recommendations designed to better protect marine life on the coast.

A new decision by the federal government on the fate of the Trans Mountain pipeline is expected in June.