Divers regularly report sea snake interactions involving chasing and biting, the reasons for which were previously unclear.
Now a study published in journal the Scientific Reports suggests that male sea snakes may think divers are potential rivals or mates, while female snakes think they are possible hiding places.
The study uses data collected by co-author Tim Lynch describing encounters with olive sea snakes in the Great Barrier Reef, Australia, from 1994-95.
In 74 of 158 encounters sea snakes approached Lynch, and this was more common in the May-August mating season.
During this period male sea snakes look for females and start courting them as soon as they see them, study co-author Rick Shine, professor of biological sciences at Macquarie University, Sydney, told CNN.
This largely involves flicking the female's body with his tongue to check the chemicals on her skin to make sure she is the right species and sex, added Shine.
"Then aligning his body with hers, maybe wrapping coils around her to hold her in place so he can position himself for copulation," said Shine. "But females often aren't interested, so they zoom away and hide in the coral."
Male sea snakes were more likely than females to approach divers, particularly during mating season, according to the study.
In some cases they would flick their tongue at the diver, and in 13 cases they charged at the diver. When a male sea snake charged the diver it came straight after an unsuccessful chase of a female, or following an interaction with a rival male.
Charges by females were observed after they had been chased by males, or had interacted with the diver before losing sight of him.
In three cases male sea snakes coiled around the diver's fin, which is normally observed during courtship.
"These patterns suggest that 'attacks' by sea snakes on humans result from mistaken identity during sexual interactions," reads the study.
Sea snakes may find it difficult to identify shapes under water, according to previous research.
"Like dogs, snakes mostly rely on scent, not vision, to work out what's going on in the world around them," said Shine, who explained that they use the tip of their tongue to take in scent cues that they then analyze using a special organ in the roof of the mouth.
Large sea snakes are potentially deadly to humans, said Shine.
"Having a giant snake hurtle towards you and start checking you out can be life-threatening even if the snake doesn't try to bite you," he added. "Panic is deadly."
The team suggests that divers should stay still and let the sea snake investigate them using its tongue.
"Our study shows that keeping calm is the key. The snake is not attacking you," Shine told CNN. "He just thinks that you may be a female snake. And once he works out that's not the case, he'll wander off to look for love elsewhere."
The research was published on Thursday.