Woman sleeping with eye mask (Woman sleeping with eye mask)

Tanya Constantine/Blend Images/Getty Images

New research has revealed a close link between our immune system and the body's natural circadian rhythms that may explain the relationship between irregular sleeping habits and autoimmune diseases.

A team of scientists set out to study a protein that regulates immune cells and, if mutated, is related to inflammatory bowel syndrome. In what immunologist Lora Hooper calls a "happy accident," they found that the protein itself was influenced by the body's "clock genes," a.k.a. the ones that want your body to get a set amount of light and darkness every day.

When our circadian rhythms are off, those clock genes affect stress hormones, inflammation, and bacteria in our gut that helps ward off infection.

"The finding adds to a growing body of research showing that a healthy pattern of light and dark, sleeping and waking, is essential to keep the immune system in balance," Hooper tells Science.

There's a reason women's magazines are always touting the importance of sleep, and this close tie to autoimmune disorders is just the latest reason to obey your body's internal clock.

More from MSN Healthy Living: