A U.S. judge on Tuesday dismissed the most serious claims in a lawsuit brought by a Canadian logging company that accused Greenpeace and another advocacy group of running a criminal enterprise to damage the company.

The case, and a similar one filed later by the developer of the Dakota Access oil pipeline, had gained the attention of civil liberties and environmental advocacy organizations who warned it could set a dangerous precedent if it were allowed to proceed.

(Read: Industry Lawsuits Try to Paint Environmental Activism as Illegal Racket)

These groups argued that the lawsuit, filed by Resolute Forest Products, aimed to silence legitimate advocacy by characterizing the basic elements of activists' campaign work as a criminal conspiracy.

By invoking the Racketeer Influenced and Corrupt Organizations Act, or RICO, a federal conspiracy law that was devised to ensnare mobsters, the lawsuit threatened the defendants with a lengthy and complex legal battle and potentially hundreds of millions of dollars in damages.

Sign up for InsideClimate News Weekly Our stories. Your inbox. Every weekend.

"The judge's decision to throw out the abusive racketeering charges is a positive development and a win for advocacy," said Tom Wetterer, general counsel for Greenpeace USA, in a statement. "From day one, it was clear Resolute intended to bully legitimate advocacy organizations and forest defenders by abusing laws designed to curtail the mafia."

While U.S. District Judge Jon S. Tigar dismissed the racketeering claims, he also ruled that defamation and unfair competition claims against Greenpeace could continue. All of the claims again the other organization, Stand.earth, were dropped.

This was the second time Tigar has ruled in the case. In 2017, he dismissed the entire lawsuit but allowed Resolute to refile the allegations in a more focused complaint.

The environmental groups had been campaigning against Resolute for years, arguing that its logging practices were particularly damaging. The lawsuit grew out of statements Greenpeace made in which it erroneously said Resolute was logging in a particular protected forest. Greenpeace later retracted the statements. The judge ruled the defamation case over this question could proceed.

Michael Bowe, a lawyer representing Resolute, welcomed that development.

"We are pleased that the Court has correctly held that Resolute has properly alleged defamation and unfair competition claims and we will be proceeding aggressively through discovery to trial," Bowe said.

In the Dakota Access case, a federal judge in North Dakota dismissed the racketeering case against some defendants, but the charges against Greenpeace are still pending. [Update: On Feb. 14, U.S. District Judge Billy Roy Wilson dismissed all the charges against Greenpeace and the other remaining defendants in the Dakota Access case, writing that the allegations fell "far short of what is needed to establish a RICO enterprise."]