Coffee drunk late in the evening resets the internal body clock which regulates a host of biological functions and genes according to a natural day/night cycle, research has shown.
The evidence suggests that the effects of caffeine go much further than simply making it harder to sleep.
Scientists discovered that drinking the equivalent of a double espresso three hours before bed-time can turn the body clock back nearly an hour.
Caffeine resets the clock by delaying a rise in the level of melatonin, the body's chief sleep hormone. Fluctuating levels of melatonin help determine the natural time to go to sleep and wake up.
Two teams of British and US scientists carried out a study of volunteers and observed what happened to individual cells exposed to caffeine.
Joint lead researcher Dr John O'Neill, from the Medical Research Council Laboratory of Molecular Biology in London said: "The effect of caffeine on sleep and wakefulness has been long established, but its impact on the underlying body clock has remained unknown. These findings could have important implications for people with circadian sleep disorders, where their 24-hour body clock doesn't work properly, or even help with getting over jet lag.
"Our findings also provide a more complete explanation for why it's harder for some people to sleep if they've had a coffee in the evening."