The board of Twitter has agreed to a $44bn (£34.5bn) takeover offer from the billionaire Elon Musk.
Mr Musk, who made the shock bid less than two weeks ago, said Twitter had "tremendous potential" that he would unlock.
He also called for a series of changes from relaxing its content restrictions to eradicating fake accounts
.The firm initially rebuffed Mr Musk's bid, but it will now ask shareholders to vote to approve the deal.
Mr Musk is the
world's richest person, according to Forbes magazine, with an estimated net worth of $273.6bn mostly due to his shareholding in electric vehicle maker Tesla which he runs. He also leads the aerospace firm SpaceX.
Why Elon Musk has been so keen to buy Twitter
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, Mr Musk said in a statement announcing the deal.
"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," he added.
"Twitter has tremendous potential - I look forward to working with the company and the community of users to unlock it."
What is Elon Musk's record on Twitter?
Mr Musk, who has more than 80 million followers on Twitter, has a controversial history on the platform himself.
In 2018 US financial regulators accused him of misleading Tesla investors with his tweets, claims that were resolved in a $40bn settlement and that Mr Musk continues to deny. And in 2019 he was hit with a defamation suit - which he successfully defeated - after calling a diver involved in rescuing schoolboys in Thailand "pedo guy" on the platform.
On Monday, Mr Musk, who has been known to clash with journalists and block critics, suggested that he saw Twitter as a forum for debate. "I hope that even my worst critics remain on Twitter, because that is what free speech means," he wrote just hours before the deal was announced.
Can Musk turn Twitter around?
As part of the takeover, which is expected to close later this year, Twitter's shares will be delisted and it will be taken private.
Mr Musk has suggested this will give him freedom to make the changes he wants to the business. Among other ideas, he has suggested allowing longer posts and introducing the ability to edit them after they have been published.
Twitter shares on Monday closed more than 5% higher after the deal was announced. But the price remained lower than Mr Musk's $54.20 per share offer, a sign that Wall Street believes he is overpaying for the firm.
Mr Musk has said he doesn't "care about the economics" of the purchase. However, he will take on a company with a chequered record of financial performance. Despite its influence, Twitter has rarely turned a profit and user growth, particularly in the US, has slowed.
The company, founded in 2004, ended 2021 with $5bn in revenue and 217 million daily users globally - a fraction of the figures claimed by other platforms such as Facebook. Bret Taylor, chair of Twitter's board, said it had fully assessed Mr Musk's offer and it was "the best path forward for Twitter's stockholders".
Elon Musk: Twitter's new king
The speed this move has happened at had many heads in Silicon Valley spinning. From nowhere, Elon Musk is the absolute monarch of Twitter.
He himself has said it's not about the "economics", this is about power and influence. By taking the company private he will exercise total control over Twitter. He has the power to do with the company as he pleases. In practice that will mean a much lighter moderation policy.
He also says that he will make its algorithm public - so that people can better understand how Twitter works. The move leaves the door open to Donald Trump's return to the platform, though he apparently says he would rather use his own social media platform Truth Social for now.
For years conservatives have argued that Twitter is biased against them - and the news has left Republicans in the US delighted. Others have been left dismayed at what Twitter might look like without strong platform moderation.
You only need to look at how much criticism Facebook has received for not taking down groups linked to the QAnon conspiracy theory, or the Stop the Steal movement to imagine how much criticism Elon Musk is in store for. The danger that Twitter now faces is that unfettered free speech on social media can become very ugly, very quickly.