Image copyright Jessica Fujii Image caption Sea otters use rocks to crack open shellfish

Sea otters may have been using stone tools for thousands or even millions of years, according to scientists.

It appears otters learned how to use tools long before other marine mammals.

Sea otters are often seen floating on their backs, using rocks to break open shellfish for food.

A genetic study of more than 100 wild sea otters living off the Californian coast suggests their ancestors living millions of years ago showed this behaviour.

Dolphins in Australia have been seen to use sponges to protect their noses when scouting for fish on the sea floor.

However, this seems to be a relatively new invention, happening less than 200 years ago.

Dr Katherine Ralls of the Smithsonian Conservation Biology Institute in Washington, US, said they were surprised to find sea otters using tools were not from the same family group, suggesting the behaviour originated in the ancestors of modern sea otters.

"It's older in sea otters," she told BBC News. "They're very smart; they'll use rocks as anvils and as hammers."

Unlike dolphins, using tools seems to be innate in all young sea otters, said the researchers.

"Orphaned otter pups raised in captivity exhibit rudimentary pounding behaviour without training or previous experience, and wild pups develop tool-use behaviour before weaning regardless of their mother's diet type," they wrote in the Royal Society journal Biology Letters.

Read the research here.

The sea otter is found along the coasts of the Pacific Ocean in North America and Asia.

They were once hunted for their fur almost to extinction.

Early in the 20th Century only 1,000 to 2,000 animals remained. Sea otters are now protected by law.

The researchers plan to study fossil remains of sea otters to confirm when the behaviour emerged.

They think depressions in the chests of some modern otters - thought to be from holding rocks on their chests - might be present in fossil specimens.

Tool use has been observed in a range of animals, including crows and primates.

"Sea otters provide a fascinating opportunity to investigate how genetic predispositions, learning, and environmental conditions contribute to a species' capacity to use foraging tools," said Dr Christian Rutz, an evolutionary ecologist at the University of St Andrews, who studies tool use in Hawaiian crows and New Caledonian crows.

"It is particularly exciting that otter pups express rudimentary tool behaviour in captivity without any demonstration or training. We have seen similar developmental patterns in our experiments with young crows."

Follow Helen on Twitter.