A judgment on whether the federal government adequately consulted First Nations on the expansion of the Trans Mountain pipeline was handed down on Thursday morning.

The case combined nearly two dozen lawsuits and contended that First Nations were not adequately consulted with before a review by the energy board or cabinet approval of the project.

The project has also been challenged in federal court by environmental groups and the cities of Vancouver and Burnaby.

On Thursday, the FCA ruled on the applications saying that the NEB’s review was flawed and that the federal government could not rely on it as a basis for its decision to approve the expansion.

The court also said that the federal government failed in its duty to engage in meaningful consultations with First Nations before approving the project.

The written ruling found that there was no "meaningful two-way dialogue" and that "The Indigenous applicants were entitled to a dialogue that demonstrated that Canada not only heard but also gave serious consideration to the specific and real concerns the Indigenous applicants put to Canada, gave serious consideration to proposed accommodation measures and explained how the concerns of the Indigenous applicants impacted Canada's decision to approve the project."

The Squamish Nation says the ruling is a recognition of Indigenous rights.

"This decision reinforces our belief that the Trans Mountain expansion project must not proceed and we tell the prime minister to start listening and put an end to this type of relationship. It is time for Prime Minister Trudeau to do the right thing," the band said in a statement.

"This is a major victory for my community," said Coldwater Chief Lee Spahan. "Thankfully, the court has stepped in where Canada has failed to protect and respect our rights and our water."

The decision means the National Energy Board will have to redo its review of Kinder Morgan Canada's project.

Tim McMillan, from the Canadian Association of Petroleum Producers, says they are frustrated by the ruling and are once again at the end of a very long regulatory process.

“This is very similar to what we saw at Northern Gateway, that at the very end of the process, after the permits had been given, the court stepped in and we hope that as we come through this one that the government would fulfil their duty completely and that it would be under construction and moving forward in a very timely manner, this looks like it’s going to add a certain amount of delay,” he said. “To Canada, It’s going to cost us about $15 billion a year to continue to have inadequate pipeline capacity. To our industry its already driving investment to other parts of the world and I think the globe is looking at Canada as a place that doesn’t have their act together and can’t get projects done. This reaffirms that and I think Canadians should expect that we have a more streamlined, understandable regulatory system than what we do today.”

Kinder Morgan shareholders voted overwhelmingly on Thursday to approve the $4.5 billion sale of the pipeline and the expansion project to the Canadian Government.

Federal Finance Minister Bill Morneau says taken together, the decisions made by the appeal court and Kinder Morgan shareholders are for the benefit of all Canadians and that the project needs to go ahead.

"As we move ahead with the project and the purchase, our government remains committed to ensuring the project proceeds in a manner that protects the public interest. That means ensuring the highest level over governance, including environmental protection. It means upholding our commitments with Indigenous peoples and it means responsibly protecting Canada's and Canadians' investment," he said in Toronto.

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.

 (With files from The Canadian Press)