VANCOUVER -- The British Columbia Court of Appeal says the province cannot restrict oil shipments through its borders in a decision that marks a win for the future of the Trans Mountain pipeline expansion.

The province filed a constitutional reference question to the court that asked whether it had the authority to create a permitting regime for companies that wished to increase their flow of diluted bitumen.

B.C. argued that its proposed legislation was meant to protect its environment from a hazardous substance, while the federal government and Alberta argued the goal was to block the Trans Mountain project.

A five-judge Appeal Court panel agreed unanimously that the proposed B.C. legislation is not constitutional because it interferes with the federal government's exclusive jurisdiction over interprovincial pipelines.

Justice Mary Newbury wrote on behalf of the panel that the substance of the proposed law was to place conditions on and, if necessary, prohibit the movement of heavy oil through a federal undertaking.

Newbury also says the legislation is not just an environmental law of "general application," but is targeted at one substance in one interprovincial pipeline: the Trans Mountain expansion project.

"Immediately upon coming into force, it would prohibit the operation of the expanded Trans Mountain pipeline in the province until such time as a provincially-appointed official decided otherwise," she says.

"This alone threatens to usurp the role of the (National Energy Board), which has made many rulings and imposed many conditions to be complied with by Trans Mountain for the protection of the environment."