Humanity's brutal and bellicose past provides ample justification for pursuing settlements on the moon and Mars, Elon Musk says.

The billionaire entrepreneur has long stressed that he founded SpaceX in 2002 primarily to help make humanity a multiplanet species — a giant leap that would render us much less vulnerable to extinction.

Human civilization faces many grave threats over the long haul, from asteroid strikes and climate change to artificial intelligence run amok, Musk has said over the years. And he recently highlighted our well-documented inability to get along with each other as another frightening factor. [The BFR: SpaceX's Mars Colony Plan in Images]

"Last century, we had two massive world wars — three if you count the Cold War," Musk said earlier this month at the SXSW festival in Austin, Texas. "I think it's unlikely that we'll never have another world war again."

He emphasized that he's not predicting an imminent global conflict, only that one is likely to occur at some point in the future, given humanity's track record. If and when that next big war occurs, Musk added, it could usher in a planet-wide "dark ages."

"Then we want to make sure that there's enough of a seed of human civilization somewhere else to bring civilization back and perhaps shorten the length of the dark ages," he said. "I think a moon base and a Mars base that could perhaps help regenerate life back here on Earth would be really important, and to get that done before a possible World War III."

A Mars base would be a sturdier civilization bulwark than a moon settlement because the Red Planet is farther from Earth, Musk added. But it's worth setting up shop on both worlds, as each outpost would thin our risk, he said.

Musk isn't all talk on this topic; SpaceX is developing a huge, reusable rocket-spaceship combo called the BFR, with the chief aim of making Mars colonization economically feasible. Musk unveiled the latest plans for this transportation system at a conference in Australia last September, and he gave a brief progress update at SXSW.

Musk has previously said that, if everything goes well with the BFR's development, the first crewed flights to Mars could lift off in the 2020s.

And getting back to existential threats: A global war and accompanying dark ages aren't at the top of Musk's list of concerns. At SXSW, he sounded the alarm once again about artificial intelligence (AI) and called for some form of public regulation of the rapidly advancing technology.

"The danger of AI is much greater than the danger of nuclear warheads, by a lot, and nobody would suggest that we allow anyone to just build nuclear warheads if they want. That would be insane," he said.

"If humanity collectively decides that creating digital superintelligence is the right move, then we should do so very, very carefully — very, very carefully," Musk added. "This is the most important thing that we can possibly do."

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