Court concludes that the federal government failed in its duty to engage in meaningful consultations with First Nations before giving the project the green light.

Canada's Federal Court of Appeal on Thursday overturned Ottawa's approval of the contentious Trans Mountain pipeline expansion.

In a unanimous decision by a panel of three judges, the court said the National Energy Board's review of the proposal was so flawed that the federal government could not rely on it as a basis for its decision to approve the expansion.

The court also concluded that the federal government failed in its duty to engage in meaningful consultations with First Nations before giving the project the green light.

Prime Minister Justin Trudeau's government approved the project in 2016 and is so determined to see the line built that it announced plans this spring to buy the pipeline and expansion project for $4.5 billion after Kinder Morgan Canada balked at moving ahead with construction.

But Finance Minister Bill Morneau is pledging to push ahead with his government's purchase of the project. Even with the court decision, Morneau said the project is in the national interest and needs to go ahead.

The ruling requires the energy board to conduct a new review —which the court suggests could be kept short — and means the government will have to redo part of its consultation with Indigenous groups.

The court found that the government's representatives "limited their mandate to listening to and recording the concerns of the Indigenous applicants and then transmitting those concerns to the decision-makers." There was no "meaningful two-way dialogue."

Environmental groups and the cities of Vancouver and Burnaby also challenged the project in Federal Court last fall. They were supported by the province of British Columbia, which acted as an intervener.

Alberta was also an intervener and the province's lawyer told the court Ottawa's decision to approve the pipeline expansion was based on broad evidence that considered environmental, economic and Indigenous interests.

The expansion would triple the capacity of the Trans Mountain pipeline from near Edmonton to Burnaby, BC, to 890,000 barrels a day. It would also increase the number of tankers in Burrard Inlet sevenfold.

The court ruled that the energy board review contained a fatal flaw: it excluded the project's impact on marine shipping. That, in turn, meant that the energy board did not assess the potential impact of increased tanker traffic on the southern resident killer whale population.

That failure "was so critical that the Governor in Council could not functionally make the kind of assessment of the project's environmental effects and the public interest that the (environmental assessment) legislation requires," said the ruling written by Justice Eleanor Dawson.

BC Premier John Horgan says the province will continue with its reference case to the BC Court of Appeal to determine if it has the right to protect its environment from the impact of a bitumen spill by regulating the transportation of hazardous substances inside provincial borders.

Horgan stopped short of saying the project is dead, but he said his government will now focus on other issues, such as housing and jobs.

Vancouver Mayor Gregor Robertson said the decision validates his city's concerns about marine impacts and Indigenous consultation.

The Federal Court case was the most significant legal challenge facing the project and the decision may still be appealed to the Supreme Court of Canada.

Kinder Morgan had already won several court victories, including one last week when the Supreme Court of Canada dismissed an application from the City of Burnaby to overturn a lower court decision.