watch nowSpaceX on Tuesday announced it entered a formal agreement to buy the artificial intelligence startup Cursor for $60 billion worth of stock, a hotly anticipated deal. The announcement comes just days after Elon Musk's rocket-maker debuted on the Nasdaq in the biggest initial public offering ever. Cursor built a popular AI coding tool that helps software developers generate, edit and review code, and the company has experienced explosive growth since its founding in 2022. In November, Cursor said it crossed $1 billion in annualized revenue, according to a release at the time. The $60 billion in class A common stack that SpaceX has agreed to pay to acquire Cursor represented a 3.4% dilution at the aerospace and tech conglomerate's IPO valuation.Shares of SpaceX gained roughly 16% on Tuesday, topping Amazon and Microsoft by market cap and making it the fourth most valuable company in the U.S.Musk merged SpaceX with his AI startup, xAI, earlier this year, and the Cursor deal looks set to help revitalize the company's efforts to compete with rivals like Anthropic and OpenAI, which also offer popular coding tools. SpaceX has not provided its investors with details on Cursor's customer list, momentum or revenue. Cursor's market share had declined from 41% in June 2025 to about 26% in May, according to spending data from Ramp. Anthropic now controls half of that category.SpaceX expects the merger to close during the third quarter of this year, according to a filing with the Securities and Exchange Commission. The transaction is subject to "requisite regulatory approvals," the filing said.Read more CNBC tech newsA year after Meta tapped Alexandr Wang to build a new AI model, Zuckerberg has to sell itAnthropic disables access to Fable 5 and Mythos 5 to comply with government directiveFrom 10% chance of success to $2 trillion market cap: SpaceX's historic IPONew SpaceX millionaires are reinventing the business of managing large wealth"We look forward to working closely with the Cursor team to advance our frontier AI capabilities," SpaceX said in a post on X on Tuesday. Venture capital firm Thrive Capital holds positions in both SpaceX and Cursor, and the combined stake is now worth more than $10 billion, according to a source familiar with the figure who requested anonymity because the details are confidential.SpaceX President and COO Gwynne Shotwell recently told CNBC's Morgan Brennan that the Cursor partnership "makes a huge amount of sense."SpaceX and Cursor did not immediately respond to CNBC's request for comment. In April, SpaceX said it had obtained the right to acquire Cursor for $60 billion later this year. If, for some reason, the deal is not consummated, SpaceX had agreed to pay Cursor a "termination fee" of $1.5 billion, and $8.5 billion in computing resources, according to its IPO filings. Cursor CEO Michael Truell said in a post on X at the time that he's, "Excited to partner with the SpaceX team to scale up Composer," referring to his company's AI model. "A meaningful step on our path to build the best place to code with AI."-- Lora Kolodny contributed reportingwatch now