An hour of moderate physical activity per day is enough to cancel out the deadly effect of sitting behind an office desk or watching TV, research has shown.
Scientists who analysed data on a million men and women found that sitting for more than eight hours a day without taking exercise significantly increased the risk of dying early.
People in this group - who include many thousands of office workers - were up to 60% more likely to die prematurely than more active and less sedentary individuals.
Heart and artery disease and cancer were the two most likely causes of death linked to an inactive lifestyle.
But the increased risk of death associated with sitting down for too long was completely eliminated by a minimum of one hour's moderate activity a day. A brisk walk or cycle ride fell into this category.
The study authors also urged office employers to be understanding about staff taking short breaks away from their desks.
Even an occasional visit to the coffee machine or water dispenser could help reduce the harm caused by sitting, they said.
Lead scientist Professor Ulf Ekelund, from Cambridge University and the Norwegian School of Sports Sciences, said: "We found that at least one hour of physical activity per day, for example brisk walking or bike cycling, eliminates the association between sitting time and death.
"And you don't need to do sport, you don't need to go to the gym, it's OK doing some brisk walking maybe in the morning, during your lunchtime, after dinner in the evening. You can split it up over the day but you need to do at least one hour."
He acknowledged that many people who commuted to work and had office-based jobs could not escape sitting for long periods of time.
For them, any break in their sedentary routine that built some activity into the day was a bonus.
"Take a five minute break every hour, go to the next office, go upstairs to the coffee machine, go to the printer," said Prof Ekelund. "Build physical activity in your everyday life. If possible, try to do some walking or active transportation to and from work."
The study, pooling together data collected from 16 previous investigations, is part of a four-paper series of research articles published in The Lancet medical journal ahead of the Olympic Games in Brazil.
Participants, mostly aged over 45 and from the US, western Europe and Australia, were placed into four equally sized groups, or "quartiles", according to their levels of physical activity.
At one end of the scale people were active for 60 to 75 minutes each day. At the other, they were only active for five minutes or less.
The researchers compared activity levels with death rates over a period of up to 18 years.
Similar results were found when the scientists looked at the TV viewing habits of a subgroup of about 500,000 people.
Watching TV for more than three hours per day was associated with an increased risk of death in all groups except the most active.
Long periods of time spent watching TV may be associated with a generally more unhealthy lifestyle, including a reluctance to take exercise, said the scientists.
Another study estimated the global economic cost of physical inactivity in 2013 to have been £1.7 billion in the UK, 27.8 billion dollars (£21 billion) in the US and 805 million Australian dollars (£460.5 million) in Australia.