Ant agriculture started 66 million years ago as fungi experienced “a heyday” in the aftermath of the asteroid that wiped out the dinosaurs, a new study suggests.

Colonies of ants began farming the organisms after the event created ideal conditions for them to thrive, despite causing global mass extinction.

Fungi are a group of organisms that include yeasts, mildews, moulds, and mushrooms.

Researchers say many animals have been growing their own food since long before humans existed.

Ted Schultz, curator of ants at the Smithsonian’s National Museum of Natural History, USA, and the lead author, said: “Ants have been practicing agriculture and fungus farming for much longer than humans have existed.

“We could probably learn something from the agricultural success of these ants over the past 66 million years.”

He added: “Extinction events can be huge disasters for most organisms, but it can actually be positive for others.

“At the end of Cretaceous, dinosaurs did not do very well, but fungi experienced a heyday.”

The asteroid impact filled the atmosphere with dust and debris, which blocked out the sun and prevented photosynthesis for years, wiping out roughly half of all plant species on the planet.

However, this time was ideal for fungi, with some thriving as they consumed the plentiful dead plant material littering the ground.

According to the researchers, many of the fungi that grew during this time likely feasted on decaying leaf litter, bringing them into close contact with ants.

These insects harnessed the plentiful fungi for food and continued to rely on it as life rebounded from the extinction event.

The study, published in the journal Science, also found that it took nearly another 40 million years for ants to then develop higher agriculture.

When ants took fungi out of the wet forests and into drier areas, the isolated fungi became completely reliant on ants to survive in the arid conditions, with the ants essentially domesticating these fungi in the same way that humans domesticated crops.

Leafcutter ants are among those that practice the most advanced strategy, known as higher agriculture.

These ants harvest bits of fresh vegetation to provide sustenance for their fungi, which in turn grow food for the ants.

Dr Schultz has spent 35 years studying the evolutionary relationship between ants and fungi, and over the years his team has collected thousands of genetic samples of ants and fungi from throughout the tropics.

For the study the researchers used samples to collect genetic data for 475 different species of fungi – 288 of which are cultivated by ants – and 276 different species of ants, 208 of which cultivate fungi.

Using this data, the scientists were able to determine when ants began using certain fungi.

The study found that ants and fungi have been intertwined for 66 million years – since around the time when an asteroid struck Earth at the end of the Cretaceous period.