Salmon use the Earth's magnetic field to navigate across the ocean as they return to their home rivers to breed, research suggests.
Each year millions of fish make the journey home in one of the toughest migrations of the animal kingdom.
The memory of the magnetic field where they first entered the sea helps them find their way back, say US scientists.
The data, in Current Biology, provide the first direct evidence that salmon use geomagnetic cues in migration.
Other marine animals, including turtles and seals, may also use the same homing mechanism, say researchers.
The journey of adult sockeye salmon from the northern Pacific Ocean back to the individual freshwater rivers of their birth is one of the toughest migrations of all animals.
There are several theories for how salmon locate their nurseries after spending years out at sea.
One hypothesis, known as natal homing, is that salmon use both chemical and geomagnetic cues to find their way home.
In order to test the theory, researchers studied fisheries data spanning 56 years charting the return of salmon to the Fraser River in British Columbia.
The route the fish chose to swim around Vancouver Island matched the intensity of the geomagnetic field near their home rivers.
Nathan Putman, a researcher at Oregon State University, told BBC News: "For salmon to find their way back home, they remember the magnetic field that exists where they first enter the sea as juveniles, and once they reach maturity, they seek that same coastal location, with the same magnetic field.
"In other words, salmon remember the magnetic field where they enter the ocean and come back to that same spot once they reach maturity."
Sea turtles, elephant seals and many other fish, including eels, tuna and sturgeon, have a similar migratory strategy, he added.
"It seems unlikely that salmon are the only ones who've come up with this really good idea for finding your way home - it likely evolved in multiple lineages."
Exactly how the fish "imprint" the magnetic field near where they were born is unknown, but the scientists believe the change from fresh to saltwater triggers some kind of neurological process.
The memory helps the fish find its way back to the mouth of its home river, and from there it uses chemical cues to locate its birth stream.
James J Anderson and Chloe Bracis of the University of Washington say the work supports recent modelling studies showing geomagnetic imprinting is feasible to return salmon to their home river. It also complements laboratory findings that trout olfactory systems can detect geomagnetic fields.
Commenting on the study, they said: "The authors build on a long series of their work on the navigation of marine animals and provide the first solid evidence that salmon use geomagnetic cues to direct their oceanic migration."
The researchers plan to carry out lab research to find out more about how salmon navigate through magnetic fields. This may eventually prove useful for commercial fisheries, they say.