A judge in Minnesota will allow two defendants facing criminal charges of shutting down a pair of tar sands pipelines to use a “necessity defense” at their upcoming jury trial.

The ruling by Judge Robert Tiffany of the Ninth Judicial Circuit in Clearwater County means that the two defendants, Emily Johnston and Annette Klapstein, will be allowed to argue that they acted as they did because of the immediate threat of catastrophic climate change.

Tiffany, in his Oct. 11 order, said the woman had presented a prima facie case that the necessity defense was warranted.

“Minnesota’s standard for the necessity defense is high,” Tiffany said. “[T]o successfully assert the defense, a criminal defendant must show that the harm that would have resulted from obeying the law would have significantly exceed the harm actually caused by breaking the law, there was no legal alternative to breaking the law, the defendant was in danger of imminent physical harm, and there was a direct causal connection between breaking the law and preventing the harm.”

A trial date for the two has been set for Dec. 11.

Johnston and Klapstein, both of the Seattle area, were part of the pipeline protests by Direct Climate Action in four states on Oct. 11, 2016. The two allegedly closed emergency valves on two Enbridge Energy pipelines about 35 miles northwest of Bemidji, Minnesota, and then waited to turn themselves in to law enforcement, according to a spokeswoman for the activist group.

The pipelines transport Canadian crude oil to a terminal in Superior, Wisconsin.

Activists from Direct Climate Action took similar actions on three other major pipelines transporting Canadian crude oil, all owned by companies other than Enbridge. They targeted sites in Walhalla, North Dakokta; Coal Banks Landing, Montana; and Anacortes, Washington. All were arrested.

The arrests were first reported by the Minneapolis Star Tribune.

Two other defendants face criminal charges for documenting Johnston and Klapstein’s action: videographer Steve Liptay and support person Ben Joldersma. They also have been granted permission to present a necessity defense and are to be tried separately from Johnston and Klapstein, according to Direct Climate Action.

“Finally, we’ll get to bring climate experts into a court of law, to describe the distance between our current reality and what physics demands of us if we hope to leave a stable planet for our kids,” said Johnston in a statement. “Doing so means there’s an outside chance we can bridge that distance—and we need every chance we can get.”

“What we did is not in dispute,” added Klapstein in the statement. “Now we’ll be able to present evidence connecting the devastation we’re seeing—from hurricanes in the Caribbean to wildfires throughout western North America—to an oil-soaked political system utterly failing to respond.”

Both Clearwater County Attorney David Hanson, who is prosecuting the case, and the women’s attorney, Timothy Phillips, of the law office of Joshua Williams in Minneapolis, declined to comment.

According to Direct Climate Action, the first two valve-turners to go to trial—Ken Ward, in Skagit County, Washington, and Michael Foster, together with media support person Sam Jessup, in Pembima County, North Dakota—were not allowed to present necessity defenses. Ward was convicted of one felony. Earlier this month, Foster was convicted on two felony counts and one misdemeanor, and Jessup of one felony and one misdemeanor charge.

Johnston and Klapstein each face charges of criminal damage to critical public service facilities and aiding and abetting, and misdemeanor criminal trespass The charges carry a potential maximum penalty of over 20 years in jail and fines up to $40,000.

Joldersma, who placed calls to Enbridge before Johnston and Klapstein closed the valve to help ensure the pipeline would shut down safely, is charged with conspiracy to commit criminal damage to critical public service facilities. Liptay, a documentary filmmaker who filmed the Johnston and Klapstein’s action, faces gross misdemeanor charges of trespass on critical public service facility, utility or pipeline. The charges carry potential time behind bars and fines.