The elaborate eye makeup worn by Queen Nefertiti and other ancient Egyptians was believed to have healing powers, conjuring up the protection of the Gods Horus and Ra and warding off illnesses.

Science does not allow for magic, but it does allow for healing cosmetics. The lead-based makeup used by the Egyptians had antibacterial properties that helped prevent infections common at the time, according to a report published Friday in Analytical Chemistry, a semimonthly journal of the American Chemical Society.

“It was puzzling; they were able to build a strong, rich society, so they were not completely crazy,” said Christian Amatore, a chemist at the École Normale Supérieure in Paris and one of the paper’s authors. “But they believed this makeup was healing  they said incantations as they mixed it, things that today we call garbage.”

Dr. Amatore and his fellow researchers used electron microscopy and X-ray diffraction to analyze 52 samples from containers of Egyptian makeup preserved at the Louvre.