The male, who lived in El Sidron in what is now Spain, ate an antibiotic fungus called Penicillium and chewed on bits of poplar tree containing salicylic acid -- the active ingredient of modern-day aspirin, researchers said.
The youngster's fossilised jawbone reveals the ravages of an abscess, and his dental plaque contained the remnants of an intestinal parasite that causes acute diarrhoea, "so clearly he was quite sick," they wrote in the journal Nature.
"Apparently, Neanderthals possessed a good knowledge of medicinal plants and their various anti-inflammatory and pain-relieving properties, and seem to be self-medicating," said study co-author Alan Cooper of the University of Adelaide's Australian Centre for Ancient DNA (ACAD).
"Certainly, our findings contrast markedly with the rather simplistic view of our ancient relatives in popular imagination," he added.
The study is the latest to recast our long-extinct cousins, long thought of as thick-skulled and slow-witted, in a more positive light.
Other recent findings have started to paint a picture of Neanderthals as sophisticated beings who made cave art, took care of the elderly, buried their dead and may have been the first jewellers -- though they were probably also cannibals.
In 2012, a study in the journal Naturwissenschaften said Neanderthals appeared to have used medicinal herbs such as yarrow and chamomile.
Neanderthals lived in parts of Europe, Central Asia and the Middle East for up to 300,000 years but appear to have vanished some 40,000 years ago.
This coincided more or less with the arrival of homo sapiens out of Africa, where modern humans emerged some 200,000 years ago.
- Vegetarian -
Neanderthals and homo sapiens interbred, leaving a small contribution of less than two percent to the DNA of all humans except for people from Africa, where Neanderthals never lived.
For the latest study, an international team did a genetic analysis of DNA trapped in the dental plaque of four Neanderthals -- two from Spy Cave in Belgium and two from El Sidron.
Calcified plaque preserves the DNA of microorganisms that lived in the mouth, windpipe and stomach, as well as bits of food stuck between teeth -- which can later reveal what a creature ate and what its state of health was.
From the oldest plaque ever to be genetically analysed, the team concluded the Belgian Neanderthals ate a diet of woolly rhino, wild sheep and mushrooms, living a hunter-gatherer lifestyle.
"Those from El Sidron Cave, on the other hand, showed no evidence for meat consumption, but appeared instead to have a largely vegetarian diet comprising pine nuts, moss, mushrooms and tree bark," Cooper said in a statement.
El Sidron at the time was in a densely forested environment, added the study's lead author Laura Weyrich, also from ACAD.
"In contrast, the Spy Neanderthals were living in a steppe-like environment, so it's easy to picture large, beastly animals wandering around as a major source of food," she told AFP.
The sick Spanish Neanderthal was the only one with traces of poplar or Penicillium in his dental plaque.