VANCOUVER -- A court has overturned Ottawa's approval of the contentious Trans Mountain pipeline expansion, halting construction on the project and sending the government back to the review phase to examine the impacts of tanker traffic and consult more deeply with First Nations.

The decision from the Federal Court of Appeal came on the same day that Kinder Morgan Canada Ltd. shareholders voted 99 per cent in favour of selling the pipeline and expansion project to the Canadian government for $4.5 billion, not including construction costs that could be as high as $9.3 billion.

Finance Minister Bill Morneau pledged to push ahead with his government's purchase and said the decisions from the court and Kinder Morgan shareholders are important steps in getting the project from Alberta to the B.C. coast built in "the right way for the benefit of all Canadians."

"Our government remains committed to ensuring the project proceeds in a manner that protects the public interest," he said in Toronto.

"It means upholding our commitments with Indigenous Peoples and it means responsibly protecting Canada's and Canadians' investment."

The fallout from the court's decision extended to the federal government's strategy to cut greenhouse gas emissions as Alberta Premier Rachel Notley pulled the province out of Ottawa's climate plan.

"Let's be clear, without Alberta, that plan isn't worth the paper it's written on," she told a news conference Thursday evening in Edmonton.

Notley wants Prime Minister Justin Trudeau's government to immediately appeal the ruling to the Supreme Court of Canada and call an emergency session of Parliament to fix the process so that the pipeline can be built.

In a unanimous decision by a panel of three judges released Thursday, 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 fatal flaw, the court said, was that 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 endangered southern resident killer whale population.

The court also found that during the final phase of Indigenous consultation, 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," Justice Eleanor Dawson wrote on behalf of the panel.

The ruling requires the energy board to conduct a new review including the impacts of tanker traffic and means the government will have to redo part of its consultation with Indigenous groups.

Morneau did not rule out seeking leave to appeal to the Supreme Court of Canada, but he suggested the government would comply with the Federal Court's requirements, saying it had given the government good direction on next steps.

Trudeau said on Twitter that he had spoken with Notley and reassured her that the federal government stands by the project and will ensure it moves forward in the right way.

The federal government will now have to consult with First Nations in a way that seriously considers their concerns and provides a response and even an accommodation in some cases, said Gordon Christie, a University of British Columbia law professor.

For example, the Coldwater Indian Band in south-central B.C. raised concerns about the pipeline route passing through an aquifer that is the sole supply of drinking water for its main reserve. The government may consider re-routing or providing a new drinking water source, said Christie.

The additional consultation with Indigenous groups might only take a few months, but the tanker traffic review is likely to be more complex and take longer, he added.

Christie said the court decision on consultation was based on established law, but another expert said the ruling appeared to shift the requirements for governments.

"We had a pretty good understanding of what the courts meant when they said that governments need to consult and accommodate but that First Nations don't have a veto," said George Hoberg, a public policy professor at the University of British Columbia.

"What seems to me is happening in this case is the court is drifting a little more towards saying, 'We're really going to take a hard look at how you engage in that consultation and sometimes we're going to be so demanding that it's pretty much equivalent to a consent type of rule.' "

The court combined into one case nearly two dozen lawsuits filed by First Nations, environmental groups and the cities of Vancouver and Burnaby calling for the energy board's review to be overturned.

Members of the Indigenous groups that challenged the project gathered on the shore of the Burrard Inlet in Vancouver to celebrate their victory.

Scott Smith, a lawyer for the Tsleil-Waututh Nation, said the group viewed "free, prior and informed consent" to be a critical part of the consultation process moving forward.

Further consultation will have to include serious examination of the community's 1,200 page environmental assessment and studies on spill potential and air quality, said Rueben George, a representative of the Tsleil-Waututh.

"A long time ago, we said they could do this the easy way or the hard way. Now they choose the hard way or the harder way," he said.

The environmental groups involved in the case also cheered the ruling, with Ecojustice, the Living Oceans Society and the Raincoast Conservation Foundation calling it a "critical win" for the climate and coastal ecosystems.

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

The B.C. government acted as an intervener in the case and also filed a separate reference case to the B.C. Court of Appeal to determine if it has the right to restrict bitumen shipments from Alberta. Premier John Horgan said Thursday the province will continue to pursue the reference case.

The decision also triggered dismay from business groups and supporters of the pipeline expansion, with Conservative Leader Andrew Scheer calling it "devastating news for energy workers across Canada and for Canadian taxpayers."

Companies in this story: (TSX:KML)

-- With files from Joan Bryden in Ottawa