The researchers recruited 24 adults, half with normal cholesterol levels, and half with levels that were moderately high to the research, which was partly funded by the California Walnut Commission.
Each was given two high-fat salami and cheese meals, eaten one week apart.
For one meal, the researchers added five teaspoons of olive oil. For the other, they added eight shelled walnuts.
Tests showed that both the olive oil and the walnuts helped to reduce the sudden onset of harmful inflammation and oxidation in arteries that follows a meal high in saturated fat.
Over time, this is thought to cause the arteries to start to harden - and increase the risk of heart disease and stroke.
However, unlike olive oil, adding walnuts also helped preserve the elasticity and flexibility of the arteries, regardless of cholesterol level.
Arteries that are elastic can expand when needed to increase blood flow.
Lead researcher Dr Emilio Ros said eating high fat meals disrupted production of nitric oxide by the inner lining of the arteries, a chemical needed to keep blood vessels flexible.
Walnuts contain arginine, an amino acid used by the body to produce nitric oxide.
The nuts also contain antioxidants and alpha-linolenic acid (ALA), a plant-based omega-3 fatty acid with health giving properties.
Dr Ros is starting a new trial to see whether the ALA in walnuts can help people with abnormal heart rhythms.
He warned against people assuming they can eat what they like so long as they accompany it with walnuts.
"Instead, they should consider making walnuts part of a healthy diet that limits saturated fats."
Professor Robert Vogel, of University of Maryland in Baltimore, said: "This demonstrates that the protective fat from walnuts actually undoes some of the detrimental effects of a high-saturated-fat diet, whereas a neutral fat, such as olive oil, does not have as much protective ability.
"This raises a very interesting issue because many people who eat a Mediterranean diet believe the olive oil is providing the benefits.
"But this research and other data indicate that's not true.
"There are probably other factors in the diet, including that it is a relatively rich source of nuts.
"This is not to say that olive oil is bad, but it's not the key protective factor in the Mediterranean diet."