North America's Monarch butterflies use a 24-hour "clock" in their antennae to help navigate the 4,000km to overwinter in Mexico, say scientists.
Every autumn about 100 million Monarch butterflies migrate to the south.
The insects navigate according to the position of the Sun, adjusting their calculations as it appears to move across the sky.
A paper in the journal Science shows the location of the clock is the antennae rather than the brain.
Scientists say the finding is a surprise as it has always been thought that the butterflies used a 24-hour clock in their brains in conjunction with their "Sun compass" when they migrated.
But some observations from 50 years ago indicated that when the butterflies' antennae were removed the insects no longer flew in the right direction.
A research team from University of Massachusetts Medical School, US, was also interested in studying the role of the antennae in butterfly social reactions as Monarchs are extremely gregarious when they migrate.
They removed the antennae from a group of butterflies and compared the way they flew with a control population in a flight simulator.
The intact butterflies all flew southwest, as normal, but the insects without antennae, although they flew strongly, headed off in random directions.
Co-author Dr Steven Reppert told BBC News: "This then perked up our interest more and set up a whole series of experiments, which essentially led us to discovering that the antennae, really we think, are the major site of the circadian clock that compensates for the movement of the Sun."
The researchers tested the molecular cycles of the circadian clock in the brains of the insects without antennae and discovered that they were still functioning normally.
Dr Reppert said: "So this suggested that: Wow! Maybe there's a clock in the antennae that's more important for the time compensated component of the insects' Sun compass orientation. It was a total surprise."
What they did next was to show that the molecular control of the clock in the antennae is identical to the way it is in the brain. They also showed that the antennal clock can sense light independently from the brain and can function independently.
Dr Reppert said: "What's so cool about what we did is it suggests that these clocks have a function that is directly related to the brain itself, that it is really regulating a central brain process."
In order to prove that the antennae contain both a light sensor and a clock, the scientists painted the antennae of one group of insects with black enamel paint and compared their behaviour with that of a group whose antennae were coated with transparent paint.
The group with the black painted antennae all flew together in the wrong direction, while those with the transparent paint were unaffected.
According to Dr Reppert: "This strongly suggested that the timing of the clocks was still apparent but since the antennae were painted black the internal clocks couldn't adjust their 24-hour oscillation to the prevailing light-dark cycle.
"So that's why their orientation was skewed. This brought everything together and really pointed towards the antennae as the major source of this time compensation mechanism."
"I think the take home message is that this really emphasises the importance of this appendage, the antenna of the butterfly.
"I think it's becoming more and more clear that the antennae have a number of functions that are independent from being odour detectors. They can function as ears, sensing sound and changes in barometric pressure, and now we can add to the list this function as a timepiece."
The paper also suggests that other insects such as foraging honeybees and ants may use their antennae in a similar way.