Tesla and SpaceX C.E.O. Elon Musk said he was worried that people didn’t understand how fast artificial intelligence was progressing, and expressed his concern that, in a worst-case scenario, a “super-intelligent” machine might decide to destroy human life.

Musk was speaking to Walter Isaacson, the president and C.E.O. of the Aspen Institute, on stage at Vanity Fair’s New Establishment Summit in San Francisco. Musk, uncharacteristically wearing a suit, detailed his fears after teasing the announcement of Tesla’s secretive project called “the D.”

“I don’t think anyone realizes how quickly artificial intelligence is advancing. Particularly if [the machine is] involved in recursive self-improvement . . . and its utility function is something that’s detrimental to humanity, then it will have a very bad effect,” said Musk.

“If its [function] is just something like getting rid of e-mail spam and it determines the best way of getting rid of spam is getting rid of humans . . . ” Musk trailed off, as the crowd laughed.

Isaacson asked Musk if his well-publicized desire to retire on Mars, part of the inspiration behind Musk’s spacecraft company, SpaceX, could help him outrun the evil machines.

“No—more likely than not that if there’s some . . . apocalypse scenario, it may follow people from Earth,” said Musk.

Earlier at the Summit, SpaceX president Gwynne Shotwell described the development of reusable transport systems that will take people to Mars as one of the company’s main goals.

“If you can’t reuse them then you have to build them from scratch on Mars or you won’t get to come back!,” Shotwell said earlier on Wednesday.

“Do you think you maybe read too much science fiction?” Isaacson asked Musk.

“Yes, that’s possible,” he said. “Probably.”

In response to a later question about Virtual Reality, Musk questioned whether or not the Summit itself might be a “simulation.”

“There’s a one in a billion chance that this is reality,” Musk said.