Spotting a few gray strands on your head? If you're wondering how they got there, scientists may have an answer, according to a new report.

>> Read more trending news

Researchers from the University of Alabama in Birmingham recently conducted a study to determine why hair loses its pigment.

To find out, researchers examined mice. They specifically monitored how the immune system’s response to attacks affects the MITF gene, a protein that helps melanocytes function properly. Melanocytes are the cells responsible for melatonin, which gives our eyes, skin and hair its color.

After analyzing their observations, they found that the MITF gene likely also controls the release of interferons, a protein that fights off viral infections. When there isn't enough MITF, the animals in the experiment produced an excess of interferons, forcing the immune system to attack the melanocytes and causing the growth of non-pigmented or gray hairs.

The scientists do not know if their observations will transfer to humans. However, they believe their research may explain why some individuals go gray earlier in life.

"Perhaps, in an individual who is healthy yet predisposed for gray hair, getting an everyday viral infection is just enough to cause the decline of their melanocytes and melanocyte stem cells leading to premature gray hair," co-author Melissa Harris said in a statement.

While she noted an infection doesn’t guarantee gray hair, “this study highlights just one mechanism that helps us better understand biological contributions to the visible signs of aging.”

Want to learn more about the findings? The results were published in PLOS Biology.