Yawning your way through the day? If you’re watching your diet, watch out—because your sleep-deprived brain may make you crave candy, chips and other junky food, recent research suggests.

The new study included 25 women and men who underwent specialized brain scans called functional MRIs after five nights in which their sleep was restricted to four hours per night…and then again after five nights of being allowed to sleep for up to nine hours per night. During each scan, participants looked at photos of healthful foods (such as carrots, dried fruit, oatmeal and fish) or unhealthful foods (such as candy, donuts and potato chips) while researchers tracked their brain activity and blood flow.

Revelation: When participants were sleep-deprived, the images of junk foods activated “reward centers” in the brain—areas associated with pleasure-seeking and drug addiction—more than the images of healthful foods did. When participants were well-rested, however, both types of food had similar effects on brain networks. Implication: People are more susceptible to the lure of unhealthy foods when they are short on Zs.

Past research has shown that, when people get too little sleep, they tend to eat about 300 more calories per day…consume more fat…and report an increased desire for sweet and salty foods. This new study provides additional support for the connection between sleep restriction and problems with appetite and weight control. So: If you’ve been battling junk food cravings, why not try getting a good night’s sleep instead of burning the midnight oil?