In what has become one of the most hotly debated takeovers of a social-media platform, the 16-year enterprise will become a privately held company.
Under the terms of the agreement, Twitter stockholders will receive $54.20 in cash for each share of Twitter common stock that they own upon closing of the proposed transaction.
The purchase price represents a 38% premium to Twitter's closing stock price on 1 April 2022, which was the last trading day before Musk disclosed his approximately 9% stake in Twitter.
Parag Agrawal, Twitter's chief executive officer, said: "Twitter has a purpose and relevance that impacts the entire world. Deeply proud of our teams and inspired by the work that has never been more important."
"Free speech is the bedrock of a functioning democracy, and Twitter is the digital town square where matters vital to the future of humanity are debated," Musk said.
"I also want to make Twitter better than ever by enhancing the product with new features, making the algorithms open source, increasing trust, defeating the spam bots, and authenticating all humans. Twitter has tremendous potential - I look forward to working with the company and the community of users to unlock it."
Musk has secured $25.5bn of fully committed debt and margin loan financing, and is providing an approximately $21.0bn equity commitment. There are no financing conditions to the closing of the transaction.
"I hope that even my worst critics remain on Twitter, because that is what free speech means," Musk said.