The researchers scanned the brains of the volunteers under two different conditions: after five nights of sleep for nine hours and after five nights of limited sleep for four hours. Scan results showed that images of junk food, such as candy and donuts, activated areas of the brain considered reward centers only in sleep-deprived people.

“The results suggest that, under restricted sleep, individuals will find unhealthy foods highly salient and rewarding, which may lead to greater consumption of those foods,” said St-Onge, the head researcher.

Sleep-deprived individuals are drawn to junk food because “when you are fatigued, your body would want calorie-dense foods that give you quick energy,” explained Samantha Heller, registered dietician and clinical nutrition coordinator at the Center for Cancer Care at Griffin Hospital, to HealthDay. It’s best to keep healthy food options around, rather than rely on junk food for temporary bursts of energy, she added.

Meanwhile, St-Onge, the study’s main author, said there’s a clear take-home message: get plenty of sleep — at least seven to eight hours — every night.