The board of Twitter approved Elon Musk's takeover bid on Monday.
For a price of $44 billion (€41 billion), Musk will take the company private, ending its run as a public company since its 2013 initial public offering.
Under the deal, shareholders will reportedly receive $54.20 per share. The deal is expected to close this year.
The price is a 38% premium on Twitter's closing price on April 1, just before Musk announced a 9% stake in the company.
The chief executive of SpaceX and Tesla took a major stake in the social media firm earlier this month before making a formal purchase offer. Musk said he had lined up about $46.5 billion (€43.4 billion) in financing.
"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," the world's richest man said in a joint statement with Twitter. "I also want to make Twitter better than ever by enhancing the product with new features, making the algorithms open source to increase trust, defeating the spam bots, and authenticating all humans."
Twitter chief Parag Agrawal said in a post on the platform: "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."
Representatives of Twitter and Musk reportedly worked through through Sunday night to finalize the deal.
What effect could the sale have on Twitter's platform?
The sale is a dramatic reversal, after the board initially adopted a so-called "poison pill" defense against his hostile takeover bid.
Musk claims he wants to buy Twitter to unleash its free speech potential. He claimed that Twitter "needs to be transformed as a private company" to build trust with users.
His proposed changes for the company include relaxing its content restrictions, and purging fake and automated accounts.
In a post on Twitter, shortly before the deal was announced, Musk said he hoped his "worst critics" would be allowed to remain on the platform.
The self-proclaimed "free-speech absolutist" is known for blocking and disparaging his critics on Twitter. He has 83 million followers on the platform.
The US Republican Party had welcomed his potential takeover, after former President Donald Trump was blocked from the platform, alongside other notable conservatives.
However, Trump told Fox News that he had no intention of returning to the platform, and would instead use his own social site, Truth Social.