LINCOLN, Neb. – A judge has struck down a Nebraska law that allowed the Keystone XL oil pipeline to proceed through the state in its proposed route to carry oil from Canada to Texas refineries.

Lancaster County Judge Stephanie Stacy issued a ruling Wednesday that invalidated Nebraska Gov. Dave Heineman’s approval of the route. Stacy says the decision should have been made by the Nebraska Public Service Commission, which regulates pipelines and other utilities.

It was a state law that could have been used to force landowners to allow the pipeline on their property.

READ MORE: Harper meets TransCanada ahead of Obama

That means that even if the Obama administration approves the pipeline – which is not certain, either – the project remains far from a slam-dunk.

Story continues below advertisement

Now, unless the law is reinstated by a higher court, Calgary-based pipeline builder TransCanada Corp. might be forced to seek permission from every last landowner on the route.

READ MORE: Holding up Keystone won’t slow increase in oil to U.S: Ambassador Gary Doer

As it stands, the company has settled with landowners in five of six states, and with more than two-thirds of those in Nebraska. But a minority have been pushing back, despite skyrocketing offers of compensation.

It’s a win for Nebraska-based pipeline opponents. They’ve argued that Heineman exceeded his authority when he approved the route in January 2013.

But TransCanada spokesperson Shawn Howard said the company is disappointed and disagrees with the Nebraska court’s decision.

“We will now analyze the judgment and decide what next steps may be taken,” said Howard in an emailed statement. “TransCanada continues to believe strongly in Keystone XL and the benefits it would provide to Americans – thousands of jobs and a secure supply of crude oil from a trusted neighbour in Canada.”

With files from Global News