A federal judge has struck down an Oakland coal-handling ban, a decision that helps clear the way for a terminal that could annually load up to 10 million tons of Utah coal onto vessels bound for Asia.

The ruling, handed down Tuesday in a California court, rejected limits the city of Oakland had placed on the proposed export terminal. The city’s analysis supporting the ban was fatally flawed, U.S. District Judge Vince Chhabria said.

Based on three days of testimony in his San Francisco courtroom last January, Chhabria ruled the Oakland City Council’s record did not include sufficient evidence to conclude coal-handling would pose a substantial danger to public health and safety.

“In fact, the record is riddled with inaccuracies, major evidentiary gaps, erroneous assumptions, and faulty analyses, to the point that no reliable conclusion about health or safety dangers could be drawn from it,” Chhabria wrote in the 37-page ruling.

The case centers on the Oakland Bulk and Oversized Terminal that developer Phil Tagami intends to build on the former Oakland Army Base at the foot of the Bay Bridge. The 34-acre project sank into controversy three years ago after news reports revealed that four Utah coal-producing counties planned to invest $53 million in the project.

Oakland officials on Tuesday stood by their decision to restrict coal.

“The city takes its responsibility to protect the health and safety of residents very seriously, particularly children whose health will be directly impacted by storage, handling and shipping of coal and coke through our neighborhoods,” City Attorney Barbara Parker said in a written statement. “The court’s ruling is disappointing. We are reviewing the ruling and will discuss our options with the City Council.”

At the same time, the ruling cheered officials in central Utah’s coal country.

“The judge’s ruling was right on. It’s a great day for coal producers in Utah,” said Carbon County Commission Chairman Jae Potter, who was a key proponent in Utah’s proposed investment. Potter said the ruling offered hope for Utah’s rural economies, through coal jobs and a broader lift for the mining industry.

“They are premium jobs that provide for families. Some have returned since the war on coal went away a year and a half ago,” the commissioner said. “Second, it’s very hard to have economic development when a major industry is in decline. This ruling will change that. It will breed more optimism.”

Oakland officials had initially embraced the $250 million terminal as a way to create jobs in a historically African-American and economically distressed neighborhood. But they later felt Tagami, who has a contract with the city to develop the site, had deceived them by failing to disclose his plans to move coal.

In 2016, the city adopted its anti-coal ordinance, and Tagami responded with a federal lawsuit alleging the city breached the development agreement.

It was later disclosed that Utah’s largest coal producer, Bowie Resource Partners, holds an option to lease the terminal and covered much of Tagami’s subsequent litigation costs.

As domestic markets for coal dry up, Asian markets are seen as the salvation of Western states’ coal industries. Officials in those states are dismayed with what they call the “Green Wall,” a zone of political opposition along the U.S. Pacific coast to anything related to shipping coal.

Utah has set aside $1.5 million to sue California over its cap-and-trade program, which raises the price of electricity generated with Utah coal. The state also joined coal producers’ suit against Washington state over its refusal to permit a major coal terminal on the Columbia River.

There is an 800-million-ton international market for seaborne coal and Utah’s low-sulfur bituminous coal is an attractive alternative to Australian coal for Asian power producers, according to Utah coal executive Michael Klein.

“There needs to be a means to get that to market,” he said Tuesday at Utah Gov. Gary Herbert’s Energy Summit. Klein’s Salt Lake City-based firm, Lighthouse Resources, is seeking to develop the blocked terminal at Longview, Wash., to ship up to 50 million tons produced at its Wyoming and Montana mines. It is the plaintiff in the suit against Washington, which has parallels with the Oakland case.

But Klein said Longview’s decision on a coal terminal was not based on its environmental impact

“We are developing an old brownfield site. It’s actually an improvement for this industrial site,” Klein said at a forum on connecting rural Utah with global markets. “The basis for denial was there were too many trains and too many ships and the impacts from trains and ships was something that the state didn’t want to see. That’s a troubling conclusion when your goal is to build your economy based on trade.”

Utah officials have parked the $53 million formerly earmarked for the Oakland terminal in a new fund set up to support “throughput infrastructure.” Potter said he hopes to tap that money soon and renew Carbon County’s investment in the project, which would guarantee half its capacity, or five metric tons, for moving Utah coal. Sevier, Sanpete and Emery counties were also involved.

But others in Utah were unhappy that the state would underwrite an out-of-state project. Chase Thomas of the Alliance for a Better Utah had traveled to Oakland two years ago to testify in support of the coal ban.

“While we are extremely disappointed in this ruling as a matter of law, our larger concern remains the inappropriateness of using funds from the [Utah] Permanent Community Impact Board to invest in an out-of-state port development project,” Thomas said.

“These funds were designed to mitigate the impact of extractive industries on the affected communities,” he said, “not to further the development of these industries or to make them more profitable for their owners.”

Chhabria conceded Oakland made strong arguments; local policy makers enjoy wide latitude to determine whether a threat to public health and safety is significant in applying a new regulation to a previously proposed facility.

“Oakland is also right to say that it has a special obligation to protect vulnerable members of the community — people who, partly because of their income status and where they live, are more likely to experience adverse health effects from pollution,” the judge wrote. “Furthermore, Oakland is probably right that local policymakers are not required to take it on faith that existing federal or state pollution standards will adequately protect people.”

The city argued that dust wafting off cars rumbling through Oakland and jostling in switching yards would build up in the air around the port and rail lines. But Chhabria found that the city’s analysis fell far short of demonstrating that a ban was needed to protect public health.

For example, Oakland’s experts failed to consider promised covers on the rail cars, which the project’s proponents have said will be used when shipping coal from Utah to the California coast. The judge also found the city lacked a defensible assessment of how coal dust emissions would degrade air quality.