A world’s wealthiest man who is founder, CEO, and chief engineer of SpaceX; angel investor, CEO, and product architect of Tesla, Inc.; founder of The Boring Company; and co-founder of Neuralink and OpenAI Elon Musk revived a bid to buy for Twitter Inc. at the original price of $54.20 a share, backtracking on his effort to quit the deal and potentially avoiding a contentious courtroom fight.

On Tuesday after the mercurial Tesla CEO proposed to buy the company at the originally agreed-on price of $44 billion.

Musk made the surprising turnaround not on Twitter, as has been his custom, but in a letter to Twitter that the company disclosed in a filing Tuesday with the U.S. Securities and Exchange Commission. It came less than two weeks before a trial between the two parties was scheduled to start in Delaware, according to AP News.

In response, Twitter said it intends to close the transaction at $54.20 per share after receiving the letter from Musk. But the company stopped short of saying it’s dropping its lawsuit against the billionaire Tesla CEO. Experts said that makes sense given the contentious relationship and lack of trust between the two parties.

RELATED: Real-Time Billionaire Elon Musk’s Ex-Girlfriend Puts Old Memories Together (Photos, Gifts) Up For Auction

“I don’t think Twitter will give up its trial date on just Musk’s word — it’s going to need more certainty about closing,” said Andrew Jennings, professor at Brooklyn Law School, noting that the company may also be worried about Musk’s proposal being a delay tactic. After all, he’s already tried to unsuccessfully postpone the trial twice.

The apparent win for Twitter sent its shares soaring more than 20% to more than $52 apiece. But the value remained lower than the takeover price, in a sign of lingering investor doubts the deal will go through.

Later on Tuesday, Mr Musk wrote in a tweet: "Buying Twitter is an accelerant to creating X, the everything app".

When Mr Musk first revealed plans to buy Twitter in a $44bn deal, he said he wanted to clean up spam accounts on the platform and preserve it as a venue for free speech.

But the billionaire, a prolific Twitter user known for his impulsive style, balked at the purchase just a few weeks later, citing concerns that the number of fake accounts on the platform was higher than Twitter claimed, per BBC.

Twitter executives denied the accusations, arguing that Mr Musk - the world's richest person with a net worth of more than $220bn - wanted out because he was worried about the price.

The back-and-forth followed a sharp downturn in the value of technology stocks, including Tesla, the electric car company that Mr Musk leads and is the base of much of his fortune.

The fight, which was scheduled to go to trial 17 October, saw the two sides face off in lengthy court filings, private messages and bitter public spats on Twitter, where Mr Musk has more than 100 million followers.

According to the Guardian, Anat Alon-Beck, a law professor at Case Western Reserve University in Ohio, said Musk appeared to be “finally listening to his lawyers”. Musk was due to be questioned under oath by Twitter lawyers on Thursday and Friday as part of preparations for the Delaware trial. “He will be a fool to not at least try to buy the company now and avoid [a deposition],” said Alon-Beck, claiming that Musk “has no defense on trial”.

Although Musk’s filing has eliminated the impending trial, the sale process is not over yet, Alon-Beck said.

“It’s not like this is going to be cleared up tomorrow,” she said. “The parties still have to approve everything, sign and finalise the deal, and Musk still has to come up with funds to close it.”

Musk’s initial argument in reneging on his offer to buy the company was that it had miscounted the number of spam or bot accounts on its platform.

However, last month the Delaware judge hearing the case agreed to let Musk expand his lawsuit to include claims from a whistleblower, Peiter “Mudge” Zatko, who had been fired as Twitter’s head of security this year but had claimed that the company was “grossly negligent in several areas of information security”.

Twitter denied it miscounted the number of spam accounts, or vexatious accounts not operated by human users, and said Zatko’s claims were “riddled with inconsistencies and inaccuracies and lack important context”.

Twitter has also been scathing about Musk’s behaviour. In its lawsuit demanding he close the deal on the agreed terms, it said Musk’s behaviour was “a model of bad faith” and accused him of treating the sale process as an “elaborate joke”.

This week a Delaware court filing disclosed text messages between Musk and others including the CEO of Twitter, Parag Agrawal. They showed how the relationship between Agrawal and Musk soured quickly this year, with the Tesla CEO asking his Twitter counterpart: “What did you get done this week?” In another text the podcaster Joe Rogan asked Musk whether he would “liberate Twitter from the censorship happy mob”.

READ NEXT: Kim Kardashian’s $150 Million Private Jet Has Strict Rules

Sources: AP News, The Guardian, BBC