Getty Images

The night shift isn’t usually anyone’s first choice, but in some professions — and in this economy — it can’t be avoided. About 26% percent of the American workforce, including health-care workers and sanitation staff, clocks in after dark, and the schedule may be taking a toll on their health.

Past research has shown that working when you’re supposed to be in bed disrupts your circadian rhythm, raising the risk of heart disease, obesity, ulcers and even depression. Now, reporting in the journal PLoS Medicine, scientists also find that rotating night-shift work can increase the risk of developing Type 2 diabetes. The backward schedule can mess with the body’s ability to use insulin properly to break down sugars in the blood, according to Dr. Frank Hu, a professor of nutrition and epidemiology at Harvard School of Public Health.

In a study involving nearly 177,000 middle-aged women enrolled in two Nurses’ Health Studies, women who worked rotating night shifts for 1 to 2 years increased their risk of developing diabetes by 5% over a 20-year follow-up period, compared with women who didn’t get assigned these shifts. Women who kept up night work for 10 to 19 years increased their risk by 40%. Working on and off at night for more than 20 years boosted the risk of diabetes by 60%.

Certainly, body weight is part of the problem, since excess weight is a risk factor for diabetes. People who work at night may snack more when they should be sleeping — and our bodies are metabolically trained to slow down as the sun sets. So the calories we take in during the evening and night hours are less likely to get burned off efficiently, and more likely to be stored as fat.

It’s not just night work that causes a problem. Simply not sleeping when you’re supposed to, or not getting enough sleep, can also wreak havoc with your metabolism, by pushing up levels of the appetite-stimulating hormone ghrelin and suppressing the appetite-curbing hormone leptin. Our circadian clocks also regulate body weight indirectly, by controlling body temperature and blood glucose levels. “The bottom line is there are probably multiple mechanisms through which disrupted sleep patterns or long term rotating night shift work can influence the risk of Type 2 diabetes,” says Hu.

The study focused on people who rotated night shift work, so they weren’t working nights routinely, but perhaps once every few days or weeks. Hu says it’s not clear whether those who regularly work at night (and therefore sleep during the day) can adjust their body clocks to avoid this increased risk of diabetes.

What intrigued Hu and his team the most was the cumulative effect that night work had on diabetes risk. The longer people worked irregular hours at night, the higher their risk of developing the disease. “It’s something people should keep in mind,” he says. “If they minimize or reduce the time they work on night shifts, they may be able to attenuate their risk.”

That’s an important lesson for those who have to work at night. They might not be able to avoid the late hours, but they should remember that sticking with a night shift schedule for too long can be harmful for their health. And because these individuals may be at higher risk of developing diabetes, they should pay more attention to things that can lower their risk, such as watching their diet, exercising and getting screened for the disease more regularly.

Alice Park is a writer at TIME. Find her on Twitter at @aliceparkny. You can also continue the discussion on TIME’s Facebook page and on Twitter at @TIME.