Good quality olive oil contains a natural chemical that acts in a similar way to a painkiller, a US study says.
Freshly pressed olive oil is the most rich in the key ingredient
Researchers found 50g of extra-virgin olive oil was equivalent to about a tenth of a dose of ibuprofen.
A Monell Chemical Senses Centre team in Philadelphia said an ingredient in the oil acted as an anti-inflammatory, the Nature journal reported.
The team said while the effect was not strong enough to cure headaches, it may explain the Mediterranean diet benefit.
The active ingredient - found in greater concentrations in fresher olives - is called oleocanthal and inhibits the activity of enzymes involved in inflammation in the same way as ibuprofen and other anti-inflammatory drugs.
Inflammation has been linked to a wide range of conditions such as heart disease and cancer.
Report co-author Paul Breslin said: "The Mediterranean diet, of which olive oil is a central component, has long been associated with numerous health benefits, including decreased risk of stroke, heart disease, breast cancer, lung cancer and some dementias.
"Similar benefits are associated with certain non-steroidal anti-inflammatory drugs, such as aspirin and ibuprofen.
"Now that we know of oleocanthal's anti-inflammatory properties, it seems plausible that oleocanthal plays a causal role in the health benefits associated with diets where olive oil is the principal source of fat."
The team was led to the discovery after one of the researchers noticed that fresh extra-virgin olive oil irritates the back of the throat in a similar way to ibuprofen.
Claire Williamson, a nutrition scientist at the British Nutrition Foundation, said: "Olive oil contains a range of bioactive compounds, but we are not entirely sure what they do.
"We believe it has some antioxidant properties, but to say it mimics a drug is taking it one step further and needs more research."
And she added olive oil was high in fat so should only be taken in moderation.