SEATTLE (AP) — Washington state lost a major legal battle Friday, which could force it spend nearly $2 billion to restore salmon habitat by removing barriers that block fish migration.

A panel of the 9th U.S. Circuit Court of Appeals last year affirmed a lower court's 2013 ruling ordering the state to fix or replace hundreds of culverts — large pipes that allow streams to pass beneath roads but block migrating salmon.

Idaho and Montana joined Washington state in asking the appeals court to reconsider the case. The court declined to do so Friday, but several judges dissented from that decision, saying it should be reconsidered because of its significance.

"This is a win for salmon, treaty rights and everyone who lives here," Lorraine Loomis, chair of the Northwest Indian Fisheries Commission, said in a statement. The group represents 21 tribes in western Washington that challenged the state over the culverts in 2001, part of decades-long litigation over tribal fishing rights.

"Fixing fish-blocking culverts under state roads will open up hundreds of miles of habitat and result in more salmon," she said.

Messages left with a spokesman for the state Attorney General's Office were not immediately returned Friday.

Washington had sought a rehearing, arguing in part that the court's decision forces the state to spend billions to replace culverts that in some cases wouldn't have an impact on salmon because other there were other barriers upstream or downstream that completely block salmon. It also said the decision would have broad implications for other land and water use management in the Northwest.

"Ordering a State to spend money on something that will make no difference is an abuse of discretion," the state argued in asking for another hearing.

Culverts, or concrete pipes or steel structures, can be a problem for fish in several ways. Among them, the angle of the structure may be too steep for fish to navigate, or stream flows running through a small pipe can be too fast for fish to swim upstream.

The U.S. government sued Washington in 2001 on behalf of the 21 tribes to force it to replace the culverts with structures that allow fish to pass through.

Seattle U.S. District Judge Ricardo S. Martinez held that fish-blocking culverts contribute to diminished salmon runs by blocking access to miles of suitable streams. In 2013, he ordered the state to replace hundreds of the highest-priority culverts within 17 years.

The state appealed, arguing that its treaties with the tribes created no obligation to restore salmon habitat.

In declining to reconsider, the panel said Friday that the lower court properly found the state violated the treaty rights of tribes to fish by building and maintaining salmon-blocking pipes under those roads. It said there's ample evidence that fixing the fish-blocking barriers will benefit salmon runs, resulting in more harvestable salmon for the tribes.

But several judges disagreed, said the panel's opinion "sets up precedent that could be used to challenge activities that affect wildlife habitat in other western states." They said the panel's decision upholds an overbroad injunction that requires the state "to spend millions of dollars on repairs that will have no immediate effect on salmon habitat.”