Every spring in Australia, billions of bogong moths migrate from the arid plains of Queensland, New South Wales and Victoria to the meadows of the Australian Alps to escape the impending heat. There, they congregate in caves like living shingles, and go dormant over the summer. Autumn arrives, and they return to their birthplaces to mate, lay eggs and die. The eggs hatch into caterpillars that develop underground through winter. The cycle continues.

How these animals complete this epic journey to a place they’ve never been and back, traveling hundreds of miles at night, for days to weeks each way, has long been a mystery. But scientists have now discovered that bogong moths have a magnetic sense to help them.

In a paper published Thursday in Current Biology, they tested how the moths reacted to moving visual cues and magnetic fields in an outdoor flight simulator and found that the winged insects use magnetic fields like a compass. While other animals like nocturnal songbirds and sea turtles are known to migrate by Earth’s magnetic fields, the researchers say this is the first reliable evidence that insects can, too.

[Like the Science Times page on Facebook. | Sign up for the Science Times newsletter.]

Australia’s small, brown, ordinary-looking bogong moths are the only known insect besides the monarch butterfly to manage such a long, directed and specific migration.