TORONTO -- The Supreme Court of Canada has unanimously dismissed British Columbia’s appeal of the Trans Mountain pipeline.

The province was asking Canada’s top court to find that B.C. has jurisdiction over what flows through the pipeline expansion project from Alberta, but the Supreme Court has found that control over the contents of the natural energy project is fully federal jurisdiction.

"We are all of the view to dismiss the appeal for the unanimous reasons of the Court of Appeal for British Columbia," Chief Justice Richard Wagner said in the oral decision following several hours of hearings on Thursday.

The province argued that it had jurisdiction to protect its environment and would be the ones most impacted by any potential spill.

“The motive is pure,” Justice Michael Moldaver said during the hearings. “The motive is to protect the environment. The purpose, however chosen, goes beyond what the authority of the province is. It makes it unconstitutional.”

The federal government has argued that letting B.C. have authority over what can travel through the pipeline on account for its right to protect its environment, would essentially give the province a veto over cross-province projects.

If B.C. had been successful they could have been in a positon to block heavy oil from moving through the pipeline, throwing into jeopardy the multi-billion dollar project and expansion that the federal government bought from Kinder Morgan in 2018.

The provincial NDP government was appealing the B.C. Court of Appeal ruling last year that found that B.C. could not restrict oil shipments coming into the province. The Supreme Court of Canada ultimately agreed with the appeal court’s decision.

Justice Malcolm Rowe said giving British Columbia the ability to control which products go through the pipeline could effectively shut down any future exports through British Columbia.

“Other substances could be added at any time -- conventional oil, any petroleum product,” he said. “In other words, shut down the petroleum industry entirely to the extent that it relates to any exports via British Columbia.”

“It seems to me this legislation is about taking away the ability of the Government of Canada to effectively approve interprovincial pipelines.”

British Columbia Premier John Horgan expressed his disappointment with the decision.

"This does not reduce our concerns regarding the potential of a catastrophic oil spill on our coast,” he said in a statement.

"Our government takes our responsibility to defend the interests of British Columbians seriously. When it comes to protecting our coast, our environment and our economy, we will continue do all we can within our jurisdiction."

In a statement, Natural Resources Minister Seamus O'Regan applauded the court’s decision.

"I welcome this afternoon's SCC ruling,” he said. “It is a core responsibility of the federal government to help get Canada's resources to market and support good, middle-class jobs. We know this is only possible when we earn public trust and work to address environmental, Indigenous peoples' and local concerns, which we are doing every step of the way on TMX.”

Alberta Premier Jason Kenney is also pleased with the decision.

"Today, the Supreme Court of Canada dismissed B.C.'s attempt to regulate the heavy oil content in a pipeline," he wrote on Twitter. "We are very pleased with this outcome and look forward to construction continuing on the Trans Mountain Pipeline."

The Trans Mountain Expansion seeks to twin an existing pipeline which runs from Edmonton to Burnaby, B.C.The federal government says the twinning is needed to transport more Canadian oil into foreign markets and reduce Canada’s reliance on the United States for export.

The federal government spent $4.5 billion to buy the pipeline from Kinder Morgan Canada back in May 2018 as a way to keep the project alive after Kinder Morgan announced it was planning to halt construction.The government does plan on selling the pipeline back to the private sector once it’s completed.

Thursday’s decision removes one of the final obstacles for the project, which is already under construction.

Indigenous communities affected by the construction have filed a legal challenge against the pipeline, arguing that they were not properly consulted before construction began.

With files from Ottawa News Bureau Online Producer Rachel Aiello and The Canadian Press