Your nose may be to blame for craving pizza, fries or doughnuts when you're tired, scientists say.
Researchers have now discovered sleep-deprivation dramatically heightens your perceived sense of smell.
However, this information is not correctly relayed to the brain, causing you to seek junk foods to feel satisfied.
Northwestern University experts made the discovery after forcing almost 30 people to have just four hours of sleep.
The next morning, volunteers were offered breakfast, lunch and dinner alongside a buffet of unlimited snacks such as crisps, cookies and hash browns.
All of the participants took part in the same experiment after a normal night's sleep, either in the run-up to or weeks after.
Scientists measured how much and what they ate to see how their choices differed depending on how tired they were.
After being sleep deprived, volunteers chose foods that were higher in calories, on average six per cent.
However, they did not eat more calories overall.
The effects were long-lasting, as participants continued to eat calorie-dense foods the following day, despite having a 'recovery' sleep.
The study is the latest of many to delve into the mechanisms behind why a lack of sleep causes unhealthy food choices.
Previous research has uncovered a cascade of changes in the body that drive sleep-deprived people to high fat, salt and sugar foods.
Most significantly, hunger regulating hormones such as ghrelin and leptin have been reported to increase.
The new research, based on 29 men and women between the ages of 18 and 40, was published in the journal eLife.
Senior author Thorsten Kahnt, assistant professor of neurology at Northwestern University Feinberg School of Medicine, said: 'People who do not get enough sleep often start to favor sweet and fatty foods, which contributes to weight gain.
'Our findings suggest that sleep deprivation makes our brain more susceptible to enticing food smells.'
He added that it may 'be worth taking a detour to avoid your local doughnut shop next time you catch a 6am flight'.
All of the participants were given sleep trackers on their wrist to monitor how much shut-eye they got.
On the night they were deprived of sleep, the volunteers were only allowed to kip between 1am and 5am.
To keep participants awake, the researchers advised activities such as watching TV and standing up.
In the second part of the experiment, the participants had MRI scans taken of their brain before the buffet.
They were then presented with a number of different smells, including the scent of foods such as gingerbread, cinnamon and caramel.
During the study, doctors observed their piriform cortex, the first area of the brain that receives information from the nose.
It sends information to the insular cortex, situated deeper inside the brain, which receives signals about smell, taste, and how much food is in the stomach.
These factors influence how much food we end up eating, the researchers wrote.
Sleep-deprived participants had more activity in the piriform cortex, suggesting they were percieving food smells more than after a normal night's sleep.
But the insula cortex also showed reduced communication with the piriform cortex, suggesting smells were not being fully understood.
Professor Thorsten said: 'When you're sleep deprived, these brain areas may not be getting enough information, and you're overcompensating by choosing food with a richer energy signal.
'When the piriform cortex does not properly communicate with the insula, then people start eating more energy-dense food.
'But it may also be that these other areas fail to keep tabs on the sharpened signals in the olfactory cortex. That could also lead to choosing doughnuts and potato chips.'