Image copyright Getty Images

Three scientists who unravelled how our bodies tell time have won the 2017 Nobel Prize for physiology or medicine.

The body clock - or circadian rhythm - is the reason we want to sleep at night, but it also drives huge changes in behaviour and body function.

The US scientists Jeffrey Hall, Michael Rosbash and Michael Young will share the prize.

The Nobel prize committee said their findings had "vast implications for our health and wellbeing".

A clock ticks in nearly every cell of the human body, as well as in plants, animals and fungi.

Our mood, hormone levels, body temperature and metabolism all fluctuate in a daily rhythm.

Even our risk of a heart attack soars every morning as our body gets the engine running to start a new day.

The body clock so precisely controls our body to match day and night that disrupting it can have profound implications.

The ghastly experience of jet lag is caused by the body being out of sync with the world around it.

In the short term, body clock disruption affects memory formation, but in the long term it increases the risk of diseases, including type 2 diabetes, cancer and heart disease.

"If we screw that system up we have a big impact on our metabolism," said Prof Russell Foster, a body clock scientist at the University of Oxford.

He told the BBC he was "very delighted" that the US trio had won, saying they deserved the prize for being the first to explain how the system worked.

He added: "They have shown us how molecular clocks are built across all the animal kingdom."

Image copyright EPA Image caption Jeffrey Hall, Michael Rosbash and Michael Young have won the highest accolade in science.

The trio's breakthroughs were on fruit flies, but their findings explain how "molecular feedback loops" keep time in all animals.

Jeffrey Hall and Michael Rosbash isolated a section of DNA called the period gene, which had been implicated in the circadian rhythm.

The period gene contained instructions for making a protein called PER. As levels of PER increased, it turned off its own genetic instructions.

As a result, levels of the PER protein oscillate over a 24-hour cycle - rising during the night and falling during the day.

Michael Young discovered a gene called timeless and another one called doubletime. They both affect the stability of PER.

If PER is more stable then the clock ticks more slowly, if it is less stable then it runs too fast. The stability of PER is one reason some of us are morning larks and others are night owls.

Together, they had uncovered the workings of the molecular clock inside the fly's cells.

Dr Michael Hastings, who researches circadian timing at the MRC Laboratory of Molecular Biology, told the BBC: "Before this work in fruit flies we really didn't have any ideas of the genetic mechanism - body clocks were viewed as a black box on a par with astrology."

He said the award was a "fantastic" decision.

He added: "We encounter the body clock when we experience jet lag and we appreciate it's debilitating for a short time, but the real public health issue is rotational shift work - it's a constant state of jet lag."

Follow James on Twitter.

Previous winners

2016 - Yoshinori Ohsumi for discovering how cells remain healthy by recycling waste.

2015 - William C Campbell, Satoshi Ōmura and Youyou Tu for anti-parasite drug discoveries.

2014 - John O'Keefe, May-Britt Moser and Edvard Moser for discovering the brain's navigating system.

2013 - James Rothman, Randy Schekman, and Thomas Sudhof for their discovery of how cells precisely transport material.

2012 - Two pioneers of stem cell research - John Gurdon and Shinya Yamanaka - were awarded the Nobel after changing adult cells into stem cells.

2011 - Bruce Beutler, Jules Hoffmann and Ralph Steinman shared the prize after revolutionising the understanding of how the body fights infection.

2010 - Robert Edwards for devising the fertility treatment IVF which led to the first "test tube baby" in July 1978.

2009 - Elizabeth Blackburn, Carol Greider and Jack Szostak for finding the telomeres at the ends of chromosomes.