On Wednesday a Nebraska judge threw out a state law that gave it's governor, Dave Heineman, the ability to unilaterally approve permits needed to build the Keystone XL pipeline through the state. It's the second time that the pipeline has been blocked by Nebraska — the first being when Heineman himself balked at approval.

Map from TransCanada

The Keystone XL pipeline is the most contentious environmental issue in American politics. Built by TransCanada, it would connect tar sands deposits in Alberta, Canada with the Gulf Coast, unlocking a particularly carbon-intensive form of fossil fuel. For several years, environmental organizations have made blocking the pipeline a top priority, considering it, as 350.org put it, the fuse to the tar sands "carbon bomb." More carbon dioxide release means more severe global warming. Because the pipeline would cross an international border, the State Department — read: President Obama — has final say in its approval.

That approval wouldn't matter much if it couldn't go through Nebraska, as the map at right shows. So we'll explain what's happening by working backward on where the pipeline stands in that state.

According to the AP, Lancaster County Judge Stephanie Stacy upheld a lawsuit filed against Gov. Heineman, who used authority granted him by the state legislature to approve a revised route through Nebraska to the pipeline junction at Steele City. That approval was granted in January 2013.

The lawsuit was filed last fall, by three landowners that would by affected by building the pipeline. To build the pipeline, portions of many landowners' property would be seized under eminent domain — which, the lawsuit argued, could only be granted by the legislature. When the legislature deferred to Heineman on approving the permit, it essentially gave him too much authority. Judge Stacy agreed.

What's interesting is that Heineman, a Republican, used to be a pipeline opponent. In 2011, he asked Obama and then-Secretary of State Clinton to reject the pipeline proposal. His concern was that TransCanada's proposed path for the pipeline would take it over the state's Sand Hills region, a geographic anomaly that acts as something of a sponge for groundwater. It sits on top of the Ogallala Aquifer, a massive source of freshwater spanning multiple states. If the pipeline ruptured in the Sand Hills, the aquifer — the source of 30 percent of America's irrigation groundwater for agriculture — could be polluted beyond reversal.

When Obama rejected the permit for TransCanada in early 2012, TransCanada then re-applied, using an updated route through Nebraska. That's the route that Heineman was granted the authority to approve, and which he approved. Until today.

What happens next isn't clear. At the end of last month, the final federal hurdle to approval, an environmental review from the State Department, was cleared. It seemed as though the decision came down to Obama. But if today's ruling is upheld, and Nebraska's Public Service Commission gets to decide whether or not the new route is satisfactory for the state, it could rule that it isn't. In effect, Obama's role could become unimportant, and Judge Stephanie Stacy could have done what so many environmentalists demanded for so long: killed any chance that the Keystone XL pipeline would be built.