Life on Earth will continue for up to three billion years but humans will die out far sooner, scientists have said.
Researchers say that our planet's increasing proximity to the sun will eventually result in soaring temperatures, the seas drying up and the extinction of all life.
But according to a study by the University of East Anglia, in Norwich, man-made climate change will make human life impossible long before this happens and o ur best chance of survival would be to relocate to another planet - with Mars being the most suitable option.
Andrew Rushby, from the university's school of environmental sciences, said: "We estimate that Earth will cease to be habitable somewhere between 1.75 and 3.25 billion years from now.
"A fter this point, Earth will be in the 'hot zone' of the sun, with temperatures so high that the seas would evaporate. We would see a catastrophic and terminal extinction event for all life.
"Of course conditions for humans and other complex life will become impossible much sooner - and this is being accelerated by anthropogenic climate change.
"Humans would be in trouble with even a small increase in temperature, and near the end only microbes in niche environments would be able to endure the heat."
Almost 1,000 planets outside our solar system have been identified by astronomers.
The team of astrobiologists looked at some of these to find out which were best placed to support life.
They found that the recently discovered Gliese 581d could be warm and pleasant for up to 54.7 billion years - 10 times longer than our solar system.
Mr Rushby said: "To date, no true Earth analogue planet has been detected.
"But it is possible that there will be a habitable, Earth-like planet within 10 light-years, which is very close in astronomical terms.
"However reaching it would take hundreds of thousands of years with our current technology.
"If we ever needed to move to another planet, Mars is probably our best bet.
"It's very close and will remain in the habitable zone until the end of the sun's lifetime - six billion years from now."
By examining the evolution of life on earth, the team were also able to make predictions about what stage life might be at in other parts of the galaxy.
"We had insects 400 million years ago, dinosaurs 300 million years ago and flowering plants 130 million years ago," Mr Rushby said.
"Anatomically modern humans have only been around for the last 200,000 years - so you can see it takes a really long time for intelligent life to develop.
"The amount of habitable time on a planet is very important because it tells us about the potential for the evolution of complex life - which is likely to require a longer period of habitable conditions.
"Of course, much of evolution is down to luck, so this isn't concrete, but we know that complex, intelligent species like humans could not emerge after only a few million years because it took us 75% of the entire habitable lifetime of this planet to evolve.
"We think it will probably be a similar story elsewhere."