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 man, 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.
“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.”
Bret Taylor, chair of Twitter’s board, said it had full assessed Mr Musk’s offer and it was “the best path forward for Twitter’s stockholders”.
Under the deal, 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.
Mr Musk’s targeting of Twitter has moved at remarkable speed. It emerged at the beginning of April that Mr Musk had become the largest shareholder in the firm with a 9.2% stake.
He was then invited to join Twitter’s board but turned down the offer before launching a surprise bid for the company on 14 April, saying he wanted to “unlock” its potential as a bastion of freedom of speech.
Twitter responded by putting in place a so-called “poison pill” defence to fend off Mr Musk. The mechanism would have created difficulties for Mr Musk if he attempted to increase his stake in the company.
Mr Musk has secured $25.5bn of financing for the deal and will put in $21bn of his own money.