Bioluminescence first evolved in animals at least 540 million years ago, new research suggests.

The study, which focused on an ancient group of marine invertebrates called octocorals, that includes soft corals, pushes back the previous oldest dated example of the trait by nearly 300 million years.

Bioluminescence is the ability of living things to produce light via chemical reactions.

Until now, the earliest dated origin of the phenomenon was thought to be around 267 million years ago in small marine crustaceans called ostracods.

Experts say it has independently evolved at least 94 times in nature and is involved in a huge range of behaviour including camouflage, courtship, communication and hunting.

Andrea Quattrini, curator of corals at the Smithsonian’s National Museum of Natural History in the US, and senior author on the study, said: “Nobody quite knows why it first evolved in animals.”

Lead author Danielle DeLeo, a museum research associate and former postdoctoral fellow, said: “We wanted to figure out the timing of the origin of bioluminescence, and octocorals are one of the oldest groups of animals on the planet known to bioluminesce.

“So, the question was when did they develop this ability?”

Along with Catherine McFadden, of Harvey Mudd College, Dr Quattrini had completed an extremely detailed, well-supported evolutionary tree of the octocorals in 2022, using data from 185 species.

Researchers were able to use fossil ages and their respective positions in the octocoral evolutionary tree to figure out roughly when the lineages split apart to become two or more branches.

With the evolutionary tree dated and the branches that contained luminous species labelled, the team then used a series of statistical techniques to perform an analysis called ancestral state reconstruction.

The data suggests that 540 million years ago the common ancestor of all octocorals were very likely bioluminescent.

That is 273 million years earlier than the glowing ostracod crustaceans that previously held the title of earliest evolution of bioluminescence in animals.

Dr DeLeo and Dr Quattrini suggest that the octocorals’ thousands of living representatives and relatively high incidence of bioluminescence suggests the trait has played a role in the group’s evolutionary success.

The findings are published in the Proceedings of the Royal Society B Biological Sciences journal.