Earth may be uninhabitable just a few centuries from now, so humanity should prepare to spread out into the cosmos, Stephen Hawking has advised.

If humanity doesn't become a truly spacefaring species in the next five centuries or so, we may well go extinct, Stephen Hawking said, according to media reports.

During a video presentation Sunday (Nov. 5) at the Tencent Web Summit in Beijing, the famed cosmologist warned that the ever-rising human population, and its mounting energy needs, could render Earth uninhabitable by the year 2600, according to the British newspaper The Sun.

Hawking therefore advised that we get our act together and "boldly go where no one has gone before," The Sun reported.

During his talk, Hawking also highlighted the exploration potential of Breakthrough Starshot, a $100 million project that aims to develop tiny, uncrewed, sail-equipped probes that will be accelerated to 20 percent the speed of light by powerful lasers.

Such nanocraft could get to Mars in less than an hour and theoretically fly by the closest exoplanet to Earth — the possibly habitable Proxima b, which lies about 4.2 light-years from us — after a space journey of just 20 years, Hawking and other Starshot team members have said.

"Maybe if all goes well, sometime a little after the middle of the century, we'll have our first picture of another planet that may be life-bearing orbiting the nearest star," Breakthrough StarshotExecutive Director Pete Worden, the former head of NASA's Ames Research Center, said at the summit in Beijing, according to The Sun.

Follow Mike Wall on Twitter @michaeldwall and Google+. Follow us @Spacedotcom, Facebook or Google+. Originally published on Space.com.