NEW YORK — Elon Musk is joining his space exploration and artificial intelligence ventures into a single company before a massive planned initial public offering for the business later this year.

His rocket venture, SpaceX, announced on Monday that it had bought xAI in an effort to help the world’s richest man dominate the rocket and artificial intelligence businesses. The deal will combine several of his offerings, including his AI chatbot Grok, his satellite communications company Starlink, and his social media company X.

Musk has talked repeatedly about the need to speed development of technology that will allow data centers to operate in space to solve the problem of overcoming the huge costs in electricity and other resources in building and running AI systems on Earth.

It’s a goal that Musk said in his announcement of the deal could become much easier to reach with a combined company.

“In the long term, space-based AI is obviously the only way to scale,” Musk wrote on SpaceX’s website Monday, then added in reference to solar power, “It’s always sunny in space!”

Musk said in SpaceX’s announcement he estimates “that within 2 to 3 years, the lowest cost way to generate AI compute will be in space.”

It’s not a prediction shared by other many companies building data centers, including Microsoft.

“I’ll be surprised if people move from land to low-Earth-orbit,” Microsoft’s president, Brad Smith, told The Associated Press last month, when asked about the alternatives to building data centers in the U.S. amid rising community opposition.

SpaceX won’t be the first to explore the idea of putting AI data centers in space. Google last year revealed a new research project called Project Suncatcher that would equip solar-powered satellites with AI computer chips.

Mississippi officials last month announced that xAI is set to spend $20 billion to build a data center near the state’s border with Tennessee.

The data center, called MACROHARDRR, a likely pun on Microsoft’s name, will be its third data center in the greater Memphis area.