GRANTS PASS, Ore. (AP) – A judge has ruled that the California Department of Fish and Game's deal allowing ranchers to continue drawing water from two Klamath Basin tributaries in return for habitat improvements does not do enough to protect threatened coho salmon.

The ruling from Judge Ernest H. Goldsmith of the Superior Court of California in San Francisco tells the department to figure out how many salmon are actually killed by water withdrawals from the Scott and Shasta rivers in Northern California, come up with some effective steps to improve salmon survival in those rivers, and give the public a chance to comment on it all.

"Despite (the department's) good faith efforts and potential hardship to water users, the Court must uphold the legislature's mandate to preserve listed species and conduct environmental review of all foreseeable consequences," Goldsmith wrote.

The department is reviewing the ruling and considering its options for moving forward, said spokeswoman Jordan Traverso.

The ruling issued April 20 came in a lawsuit brought by groups representing salmon fishermen, an Indian tribe, and conservation groups challenging the legality of the Shasta Valley and Scott River Watershed-Wide Permitting Programs. The department approved the programs in 2010 to bring about 100 farms and ranches into compliance with the state Endangered Species Act in an area that had seen fierce pockets of resistance.

"This ruling does not put water back in the river or fish back in the river,” said Klamath Riverkeeper Erica Terence, one of the plaintiffs in the cases. "It just keeps at bay a program that quite possibly would have done more harm than good.”

Federal threatened species protection for Klamath Basin coho led to the shut-off of irrigation water to more than 1,000 farms and ranches on a federal irrigation project straddling the Oregon-California border in 2002, but did not affect irrigation on private lands in the Scott and Shasta valleys. California protected coho in 2005.

Historically, the Scott and Shasta rivers offered important habitat for coho salmon in the Klamath Basin, but have seen numbers falling to dangerously low levels in recent years. Last year the Scott – which regularly runs dry from irrigation withdrawals, requiring thousands of young fish to be rescued – saw only 881 adult coho return, according to the department. The Shasta saw only 49. Two out of three years, no fish return to the Shasta.