DON EDWARDS SAN FRANCISCO BAY NATIONAL WILDLIFE REFUGE, Calif. — If you took a short kayak trip a few years ago to tiny islands nested in former salt ponds near Silicon Valley, you would have found plastic bird decoys all over. With their snowy white bodies, black crowns and sharp red bills, the decoys looked like real Caspian terns, a graceful migratory bird the size of a large crow.

The goal of those doppelgängers was to lure terns to breed on the islands, and, in doing so, prevent endangered salmon and trout living hundreds of miles to the north from vanishing.

The Columbia River Basin on Oregon’s northern border was once one of the most productive salmon habitats in the world. But commercial fishing and the construction of dams over the last two centuries have contributed to the decline of wild salmonids by 95 percent. The fish are protected under the Endangered Species Act. But that doesn’t stop traveling terns, which are themselves protected under the Migratory Bird Treaty Act, from eating the salmon and undermining their recovery.

“It’s a very difficult situation, given the competing interests,” said Alex Hartman, a wildlife biologist with the U.S. Geological Survey’s Western Ecological Research Center in Dixon, Calif.