Dentists are always telling us to avoid sweet, sticky foods for the sake of our teeth – and it had been believed that this was a problem unique to modern humans.

Yet scientists have now discovered the very first evidence of teeth which had been rotted away by an unhealthy diet in the Stone Age, long before humans started turning farmed crops into sugary snacks.

A team of researchers from the Natural History Museum analysed the skeletal remains of 52 adults who were buried together in Moroccan cave between 15,000 and 13,700 years ago.

Download the new Independent Premium app Sharing the full story, not just the headlines

As well as finding unprecedented levels of bad oral hygiene, they discovered evidence that the group had cooked nuts foraged from nearby – making the treats sweet and, crucially, sticky.

“This is the first time we've seen such bad oral health in a pre-agricultural population,” said Isabelle De Groote, who co-authored the report.

Her team found evidence of decay in more than half of the surviving teeth – levels similar to those found in modern-day societies.

Until now the earliest remains shown to have such cavities were from early agricultural populations, which were the first to process wheat and barley into high-sugar foods like porridge and bread.

“This evidence predates the first signs of food production by several thousand years,” reads the study published in the journal Proceedings of the National Academy of Sciences.

Scientists found the remains of pine nuts and sweet North African acorns alongside the hunter-gatherers, as well as the remnants of grindstones which could have been used in cooking preparation.

The University of Leicester’s Marijke van der Veen told New Scientist: “A heavy reliance on certain plant foods well before people started to rely on cultivated plants could, in certain circumstances, lead to significant [tooth decay] levels.”