Coffee has secret trick to stop sleep
Their study, in Science Translation Medicine, showed caffeine was more than just a stimulant and actually slowed down the body's internal clock.
A double espresso three hours before bedtime delayed the production of the sleep hormone melatonin by about 40 minutes, making it harder to nod off.
Experts said our own actions had a huge influence on sleep and the body clock.
One of the researchers, Dr John O'Neill, from the Medical Research Council's Laboratory of Molecular Biology in Cambridge, told the BBC News website: "If you're tired and having a coffee at night to stay awake, then that is a bad idea, you'll find it harder to go to sleep and get enough sleep."
In his half of the study, cells grown in a dish were exposed to caffeine to work out how it changed their ability to keep time. It showed the drug was able to alter the chemical clocks ticking away in every cell of the human body.
Meanwhile, five people at the University of Colorado Boulder, in the US, were locked in a sleep laboratory for 50 days.
And as light exposure is the main way we normally control our body clock, they spent most of their incarceration in very dim light.In a series of experiments over the month and a half, the scientists showed that an evening dose of caffeine slowed the body clock by 40 minutes.
It had roughly half the impact of three hours of bright light at bedtime.