(CNN)Narwhals are known as the "unicorns of the sea," but the reason for the whales' showy tusks has long mystified scientists.
Little was known about the tusk's function because narwhals spend most of their lives hidden underneath the Arctic ice. Researchers have speculated that the tusk, which grows out of the animal's head in a spiral pattern, was used as an environment sensor or to hunt.
Now a new study suggests the true evolutionary purpose of these horns -- which can be 8-feet-long -- has to do with sex: The tusks, the research found, are used by male narwhals to compete for and attract mates, a bit like a peacock's ostentatious feathers or an elk's elaborate antlers.
The researchers examined the measurements of 245 male narwhals living in waters off Greenland over the course of 35 years. They found that the largest male narwhals had disproportionately long tusks.
"Broadly, I'm interested in sexual selection, which is responsible for creating some of the craziest traits in biology," said Zackary Graham, an Arizona State University researcher and an author of the study, in a news release. "As an evolutionary biologist, I try to understand why some animals have these bizarre traits, and why some don't."
In other animals, sexually selected traits often exhibit disproportional growth when comparing individuals of the same age, the study said. Graham and the other researchers compared the growth of the tusk to the narwhal's body size and its tail, or fluke -- a trait that is unlikely to have a sexual function.
"We also predicted that if the narwhal tusk is sexually selected, we expect greater variation in tusk length compared to the variation in fluke width," said Graham.