Story highlights Gary Johnson was asked about his past comments on climate change.

He called them a joke, but said humanity needs to leave the Earth.

(CNN) Libertarian presidential nominee Gary Johnson offered an outta this world solution on Sunday to the planet's environmental crises.

"We do have to inhabit other planets. The future of the human race is space exploration," Johnson said on ABC's "This Week."

Johnson was responding to a question about comments he made in 2011 at the National Press Club when he said people should think about global warming in the long term, because one day in the distant future, "the sun will engulf the Earth."

The third-party candidate waved off his past remarks, calling them a joke.

"Can't we have a little humor once in a while," Johnson asked before elaborating on the same line of thought. "That is long term. I mean, plate tectonics, at one point Africa and South America separated. And I am talking now about the Earth and the fact that we have existed for billions of years."

Read More