(Bloomberg) -- Elon Musk and Jack Ma matched wits publicly for the first time. And boy, they didn’t disappoint.

An onstage debate between China’s richest man and the Tesla Inc. boss left a largely Chinese audience both awestruck and dumbfounded as the pair sparred over everything from the existence of aliens to the preservation of human consciousness. Musk, alternating between tech visionary and larger-than-life Bond villain, argued that AI will soon surpass the human race; that civilization may end and hence humankind needed to explore the cosmos (specifically Mars); and that people are essentially dumb creatures circumscribed by genes.

But Musk, who appeared discombobulated at times following a late trans-Pacific flight, met his match in a fellow billionaire who parried him at every turn. The Alibaba Group Holding Ltd. co-founder espoused a focus on life on Earth and argued that machines will never surpass their makers. Ma, the more polished and down-to-earth speaker, also invoked familiar stances on education and the need for “Love-Q” or LQ in addition to IQ to survive the future. But overall, the Alibaba honcho came across as more reasonable than the erratic Musk, who several times trailed off into poorly articulated tangents such as the timeline of civilization or pace of technological change (“It does seem like a long time... Is that good or bad? I dunno.”)

Just about the only thing they agreed on was that the global population was on the brink of collapse thanks to current birth rates -- a looming disaster the planet is ill-prepared to tackle.

“Most people believe that we have too many people on the planet. This is an outdated view,” Musk told the World AI Conference in Shanghai, as Ma nodded. “Assuming there’s a benevolent AI, the biggest problem the world will face in 20 years, is a population collapse. Not explosion. Collapse.”

Read more: When Elon Met Jack: Musings on AI, Mars, the End of Civilization

The showdown was the highlight of the conference, which kicked off on a rainy Thursday in the shadow of a U.S.-Chinese conflict that has at times appeared to pull the world to the brink of chaos. The Tesla and SpaceX founder’s very presence at a government-backed conference on artificial intelligence was a signal to Washington, which is trying to contain China’s ascendancy and growing prowess in cutting-edge technology.

From Jack Ma to Tencent Holdings Ltd. founder Pony Ma, the leading lights of China’s internet industry gathered in Shanghai this week to showcase the country’s latest advances in artificial intelligence. And Musk, whose moment on stage brought droves of camera-toting spectators out of their seats, effectively lent credence to China’s vision of becoming the world leader in the technology by 2030 just as Donald Trump wages a campaign to rein in the world’s No. 2 economy.

Read more: Musk Joins China AI Summit Despite Trump Ordering Firms Out

While the billionaire entrepreneur was careful to steer clear of the trade war or longer-term geopolitical tensions, he spoke freely on almost everything else -- including the possibility that life as we know it may end abruptly. “We don’t have much time,” Musk said. “This is the first time in the 4.5 billion-year history of Earth that we’ll be able to extend life beyond Earth,” he added. “Let us secure the future so the light of consciousness is not extinguished.”

The debate at times turned heated, especially when Ma questioned his opponent’s belief that AI may someday prevail over the human race. “The biggest mistake I see people making is to assume they’re smart,” Musk countered. AI will be “much smarter than the smartest human you will ever know.”

Ma likened the view that humans won’t be able to compete with their machine inventions in most aspects of life -- Musk’s stance -- to people of a century ago trying to out-run cars they manufacture. “I never in my life say human beings will be controlled by machines, it’s impossible,” said Ma, eliciting Musk’s trademark Bond-villain chortle and the retort: “I very much disagree with that. The biggest mistake I see people making is to assume they’re smart.”

It didn’t all go according to script. At one point, Ma surprised listeners -- the spectacle was livestreamed -- when he appeared to do a 180 on his infamous advocacy of slavish work hours. On Thursday, he proclaimed that people should be able to in fact work 12-hour weeks, a seeming reversal of comments just months prior that it’s a privilege to work “996,” or nine to nine, six days a week.

Read more: Jack Ma: Forget Long Days, AI Could Bring 12-Hour Work Week (1)

--With assistance from Edwin Chan, Bruce Einhorn and Ville Heiskanen.

To contact the reporters on this story: Edwin Chan in Hong Kong at echan273@bloomberg.net;Lulu Yilun Chen in Hong Kong at ychen447@bloomberg.net;Chunying Zhang in Shanghai at czhang714@bloomberg.net

To contact the editors responsible for this story: Peter Elstrom at pelstrom@bloomberg.net, Edwin Chan, Vlad Savov

©2019 Bloomberg L.P.