In a remarkable turnaround, the board of Twitter has accepted Elon Musk's $44 billion bid to buy the social media company—not long after it rebuffed the billionaire's buyout attempt.

Under the agreement, Twitter stockholders will get $54.20 per share. According to a press release from Twitter, that's 38% higher than the closing price on April 1, the day before Musk announced he had a 9% stake in the company.

Twitter's share price stood at $50.65 at the start of Monday and was up to $52.01 in intraday trading.

Musk, the CEO of automobile maker Tesla and aerospace company SpaceX, was set to join the Twitter board as the microblogging platform's largest individual shareholder but later backtracked, revealing his aspirations to buy Twitter outright and take the company private.

In an April 13 filing with the U.S. Securities and Exchange Commission, Musk made official his plans, stating that he had invested in the company to explain free speech before determining "the company will neither thrive nor serve this societal imperative in its current form."

In a TED interview the following day, Musk said that although he wants the company to become private, he wants its code to become open source and placed on GitHub. (Twitter is already working on an "open and decentralized standard for social media," called bluesky.)

He added that he wants to introduce an "edit" button for tweets and to crack down on crypto scam and spambots. Musk, a Dogecoin fanatic, has also floated the idea of accepting DOGE as payment for Twitter's premium subscription service.

But the board balked at the plan, invoking a "poison pill" to prevent him from buying more than 15% of the company. In response, Musk made a new filing with the SEC, offering to buy stock directly from shareholders at $54.20 apiece.

In the face of Musk's determination, the board relented, with Chair Bret Taylor calling it "the best path forward for Twitter's stockholders."

"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 in a press release today, adding: "Twitter has tremendous potential—I look forward to working with the company and the community of users to unlock it."

Daily Debrief Newsletter

Start every day with the top news stories right now, plus original features, a podcast, videos and more.