BY Fast Company 2 MINUTE READ

Elon Musk has reportedly once again changed his mind, according to a new security filing, and will now purchase Twitter at his original offer price of $54.20, putting the $44-billion deal back on track.

The sudden—and unexpected—twist in the soap opera-like saga comes just days before Musk was scheduled to be deposed in the legal battle between the two parties. Musk has been trying to get a Delaware court to dissemble the deal, but has not made much headway thus far.

Musk had accused Twitter of fraud, saying Twitter under-reported bots on the site. But Twitter has maintained that the deal was an airtight one, essentially the business equivalent of an “As Is” housing purchase.

“The writing was on the wall. He was going to lose the court battle,” Dan Ives, Wedbush Securities managing director, told CNBC’s Fast Money Halftime Tuesday.

Even the appearance of a whistleblower who said security holes at the company caused “real harm to real people” did not seem to sway the judge overseeing the case.

With Musk now apparently agreeing to buy the social media company, the deal is likely to close quickly, perhaps as early as Friday, say some observers. Twitter’s board and shareholders have already signed off on the purchase price, meaning there are no more hurdles to clear. That is, of course, assuming Musk doesn’t change his mind again before the deal closes. With Elon, nothing is ever done until it’s done.

Ives, though, says he thinks the agreement will be completed this time.

“He needed to get this done. Otherwise, it was going to be a long and ugly court battle and ultimately he was going to buy it at $54.20 anyway,” he said.

CNBC’s David Faber reported that Musk sent a letter to Twitter and the court Monday night saying he wanted to drop the litigation and planned to follow through with the deal.

Twitter shares spiked nearly 13% to $47.93 a share on early reports of the agreement before trading was halted for news pending.

Musk was scheduled to be deposed on either Oct. 6 or 7, with his lawyer being deposed later today. That could have resulted in some humiliating moments, as a cache of his text messages with everyone from Jack Dorsey to his ex-wife became public via court documents last week. Musk could have been extensively questioned about those.

Musk has been outspoken about changes he’d like to see at the social media company, emphasizing his definition of “free speech.”

“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,” said Musk after the deal was originally announced. “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 has tremendous potential—I look forward to working with the company and the community of users to unlock it.”

Other changes he has touted include an edit button for tweets, which launched yesterday for users in some countries, and purging the site of spam bots. He has also proposed making the company’s algorithms available for everyone to inspect, and showing why certain tweets are promoted.

Musk’s critics note the entrepreneur has little tolerance for speech that’s unflattering to him or his companies. And both Tesla and SpaceX have a history of punishing people who go public with criticism of a company practice or project.