Fermented carbohydrates in the nuts caused cavities, tooth decay and bad breath, said the study led by British scientists in the Proceedings of the National Academy of Sciences, a US journal.
The findings offer the earliest evidence of nut harvesting and storage among African hunter-gatherers, and are based on dozens of hole-riddled dental remains found in Morocco's Taforalt Cave.
Dental woes have long been believed to originate in later farming cultures some 10 000 years ago, when people began eating processed foods on a wide scale.
Toothaches were presumed rare among hunter-gatherers. But this research suggests they arose earlier than previously thought by several thousand years.
Toothache and bad breath
The study pointed to an "exceptionally high prevalence of caries", or dental disease, found in 51% of teeth among the adult remains.
That is far higher than the rate of tooth decay generally seen in hunter-gatherers, which has ranged from zero to 14%, and much closer to the level seen in prehistoric farmers, said the study.
"The majority of the people's mouths were affected by both cavities in the teeth and abscesses," said co-author Isabelle DeGroote of Liverpool John Moores University.
"They would have suffered from frequent toothache and bad breath."
The latest analysis was done on a total of 52 adults whose remains were found in the 1950s as well as during more recent excavations that were begun in 2003.
Scientists used accelerator mass spectrometry to date the remains and potent microscopes to identify the fossils of plant material which included acorns, pine nuts, juniper berries, pistachios and wild oats.
Exploitation of wild plant resources
There were so many remnants of acorns that researchers came to the conclusion that they must have been harvested and stored for eating as a staple food all year long.
"This is the first time we have documented this set of behaviours in the Iberomaurusian," a distant culture that thrived in the Maghreb, said lead author Louise Humphrey of The Natural History Museum of London, in an email to AFP.
"It is the earliest documented evidence of systematic exploitation of wild plant resources in hunter-gatherers from Africa."
Iberomaurusian people inhabited Taforalt some 13 000 to 15 000 years ago.
How to keep your teeth healthy
Carbs can rot your teeth