A group of Dunedin scientists have shed some light on what makes the tails of New Zealand glowworms glow.
The illuminating discovery could help develop new tools to assist in medical research.
The magical sparkly blue-green light of glowworms has captivated Kiwis, tourists and scientists alike for years.
Dr Miriam Sharpe from the Otago University biochemistry department says they glow to attract their prey.
"So they eat other insects and they make light to bring those insects in," she told Newshub.
Until recently, there'd never been a study into how they produce that light.
Glowworms are a kind of glowing maggot and it was thought their lanterns worked much the same as other glowing organisms.
"We thought the chemistry would be similar to the other insects - the fireflies - but it turns out it's been very different," says Prof Nigel Perry from the Otago University chemistry department.
Researchers from Otago University's Chemistry and Biochemistry departments worked together, collecting glowworms from caves and riverbanks across the country.
Back in the lab, the tails - or light organs - of the glowworms were cut off, so scientists could test the ability of proteins to produce light
Many other glowing creatures have been studied around the world, with their bioluminescence now used as a practical tool in biomedical research.
It could spark a billion-dollar industry.
The next challenge for the team is whether they can synthesise the natural chemistry of the Kiwi glowworm back in the lab.