The ruling came a week after the RCMP began rounding up protesters on Burnaby Mountain, where Kinder Morgan is conducting drilling work related to its proposed Trans Mountain pipeline expansion.
More than 100 people were arrested, nearly all of whom faced civil contempt proceedings for violating a court injunction ordering them to keep away from two drilling sites.
The company admitted it provided incorrect GPS co-ordinates when it initially sought the court order. At one location, the co-ordinates were so inaccurate that the actual work site was entirely outside the area covered by the injunction.
Texas-based Kinder Morgan went to court Thursday asking that the injunction, which is set to expire on Dec. 1, be extended to Dec. 12.
Not only was the extension denied, but the judge, who had raised serious concerns about the GPS errors, ended the hearing by inviting Kinder Morgan's lawyer to drop the civil contempt proceedings. The company then applied to have the cases withdrawn and the judge granted the application.
Earlier in the day, Judge Austin Cullen suggested the GPS errors would raise reasonable doubt in any subsequent civil contempt proceeding.
"What's happened thus far is that apparently people have been arrested on the basis of an order that refers to some other piece of property," said Cullen, prompting laughs and jeers from the courtroom's crowded public gallery.
"The concern is that people have been arrested and subjected to restraints on their liberty," he said later.
The judge's order affects anyone cited for civil contempt before the judgment was made. Cullen also revised the injunction to fix the GPS co-ordinates, which means the ruling won't affect anyone who might be arrested for violating the injunction from now on.
It also won't affect the handful of people facing criminal charges, including for assault and obstruction of justice.
"I'm thrilled," protester Lynne Quarmby, who was arrested last week, said outside court. She is a biochemistry professor at Simon Fraser University, which is located on Burnaby Mountain,
"I think that Trans Mountain's incompetence showed up very clearly in court today, and that's a good thing."
Burnaby Mountain has become the focal point for anti-pipeline protests. Activists set up an encampment in September and protests have focused not only on the Trans Mountain project but on any attempt to transport crude from Alberta's oilsands.
Kinder Morgan's preferred route for the expanded Trans Mountain pipeline would tunnel through the mountain. The recent work involved drilling two bore holes to remove samples as the company prepares for the federal approval process.
Company spokeswoman Lizette Parsons Bell said she hoped there would be no more arrests as crews work to remove equipment by Dec. 1.
"We never wanted it to get to a point where people were being arrested," Parsons Bell said in an interview.
"While we understand that people have varying opinions, we hope they will respect that the workers need to be able to clear up the site and get out of there in a safe manner."
Parsons Bell said the company was disappointed it did not receive an extension, but she said officials were confident they have enough information to submit their findings to the National Energy Board.
Grand Chief Stewart Phillip of the Union of B.C. Indian Chiefs was arrested Thursday morning. Like many pipeline opponents before him, Phillip announced his intention to be arrested before walking past a police line that surrounded the work site.
He and his supporters trekked through dense brush to the site. He was arrested to the beat of a native drum and singing.
"I said that if push came to shove and there were arrests, that I would stand with the courageous people that were willing to be arrested as a matter of principle," he said before his arrest.
"We need to reclaim this country ... and return it back to the voices of the people that have invested a lifetime of hard work to build this province."
Follow @ByJamesKeller on Twitter
— With files from Tamsyn Burgmann
Also on HuffPost