A lawsuit has pitted six landlocked states against Washington State over a simple question: Who owns the federal ports?

Washington State is denying the states the permits required to build a large coal export terminal along the Columbia River. The states have sued and Washington filed a motion for dismissal.

But U.S. District Court Judge Robert Bryan rejected Washington State’s motion, setting the stage for a legal showdown over who really gets final say over which products flow through the nation’s sea ports.

“We’re talking about the Constitution and the rule of law,” said Montana Attorney General Tim Fox, “One state can’t discriminate against another state’s commodities in this way.”

Montana and Wyoming are leading plaintiffs and two of the largest coal-producing states in the country. The Powder River Basin contains 2.5 billion tons of recoverable coal and currently supplies 40 percent of the coal used in the United States. But as many states wean themselves off of electricity from burning coal, coal companies are looking to boost exports, primarily to Asia. But they have a major problem: there are no ports along the West Coast currently set up to load coal onto ships.

Four other states, Kansas, Utah, South Dakota and Nebraska, have joined the lawsuit against Washington State.

The Millennium Bulk Terminal, proposed for the port in Longview, Wash., was supposed to solve that obstacle. It was designed to export 44 million metric tons of coal a year. Important allies and trading partners Japan and South Korea were eager to buy the coal. But after conducting an environmental impact study, the state of Washington denied the terminal a required water permit.

“I think we’re on sound ground,” said Washington’s Democratic Governor Jay Inslee, “because we’re enforcing our environmental rules for clean air and noise and some other issues.”

The Washington Ecology Department cited a slight increase in cancer risk to Longview residents due to increased diesel emissions from additional train traffic, significant vehicle traffic delays, noise, the destruction of 24 acres of wetlands and a 25 percent increase in ship traffic on the Columbia River. An Ecology spokesman denies rejecting the coal terminal because of any bias against coal or the environmental impacts caused by burning the coal in Asia.

“It is insulting to all Washington residents that proponents of this facility have chosen to minimize and ridicule the impact diesel emissions from the largest operation of the largest coal export facility in North America would have had on the people of Cowlitz County,” said Ecology’s spokesman Dave Bennett.

But Governor Jay Inslee makes no secret of his disdain for coal. In his 2007 book, “Apollo’s Fire: Igniting America’s Clean Energy Economy,” Inslee wrote, “coal is killing us. If we fail to restrain growth of CO2 emissions all six billion of us on this little spaceship are at risk.”

He also wrote that coal and cars are in a race to be the greatest danger to our climate. And at a recent news conference in which he announced Washington state would file its 32nd lawsuit against the Trump Administration over the dismantling of president Obama’s Clean Power Plan, Inslee said: “We’re breathing smoke from Mississippi, we’re breathing smoke from the rest of the United States. We have an interest in reducing coal smoke from all over the United States.”

Hal Quinn, president and CEO of the National Mining Association, said it’s perfectly clear that Inslee and the state’s Ecology Department blocked the coal terminal because of their opposition to coal.

“Coastal states like Washington cannot use their personal preferences to block trade, international trade, or even interstate commerce,” said Quinn. “The Constitution bars that, this is exactly what our founding fathers had in mind to avoid.”

But a lawyer for Earthjustice said there’s nothing illegal about being biased against coal and wanting to protect citizens from the impacts of climate change. Kristen Boyles argues coal companies are already able to get coal to foreign markets through ports in Canada, the southwest and East Coast.

“[Coal] does not have to go this particular way,” said Boyles, “and there’s nothing in the Constitution that says products have to be shipped by the shortest route or the cheapest route.”

Tim Fox said that argument misses the point. He argues this fight is over preventing chaos between states that disagree politically. If Washington state can block exports of coal, what’s to stop Georgia from blocking exports of Washington apples?

“It’s irrelevant whether you could go elsewhere,” said Fox. “Each state has the right to market their commodities without interference from another state.”