Elon Musk’s offer to buy Twitter for $54.20 a share on Tuesday—the same offer he made all the way back in April—comes with a condition: that Twitter’s lawsuit to force him to buy the social media company end.
Musk’s filing to the U.S. Securities and Exchange Commission that he is, again, ready to buy Twitter comes after a string of setbacks for the Tesla CEO in the Delaware Court of Chancery.
If Twitter’s lawsuit in Delaware succeeded, Musk would have been forced to complete his $44 billion offer to buy the social media company. The Tesla CEO publicly backed out of the deal in July, following weeks of statements that he might walk away due to concerns about spam accounts.
“Writing was on the wall [Musk] could not win in Delaware,” Dan Ives, senior equity research analyst at Wedbush Securities, said on Twitter, with the offer potentially saving “both sides a long and ugly court battle ahead.”
Musk was scheduled to be deposed on Oct. 6 and 7, with the trial starting just over a week later on Oct. 17.
On Tuesday, Twitter said that it intends to complete the transaction at $54.20 a share. Twitter’s lawsuit against Musk will continue until the two sides reach a deal, despite Musk’s offer. “The lawsuit won’t stop dead in its tracks,” Eric Talley, a professor at Columbia Law School, told The Verge.
Twitter did not immediately respond to Fortune’s request for comment.
When Musk abandoned his offer to buy Twitter earlier this year, the Tesla CEO accused the social media company of hiding the true number of bots on the platform.
He claimed that independent analysis showed the proportion of spam accounts being far higher than the 5% claimed in Twitter’s filings to the SEC.
Twitter, for its part, argued it had given Musk the data the company uses to estimate the number of bots. The social media company even granted Musk access to the “firehose”: all tweets posted on the platform.
A pretrial hearing on Sep. 27 revealed that Musk had hired five companies to parse through the company’s data, only for the Tesla CEO not to use any of their findings in his arguments. Twitter said it could uncover the findings of two companies in submitted evidence: One argued that Twitter’s estimate of 5% was correct, while the other could only guess with low confidence that 11% of Twitter accounts were bots.
Even that higher number is far below Musk’s claims, such as when the Tesla CEO said in May that his “lowest estimate” for spam accounts on Twitter was 20%, and that the true number was probably far higher.
The bumper Sept. 27 pretrial hearing ended in a censure motion against Musk after Twitter lawyers revealed that he’d not only used Signal, an encrypted messaging app, to communicate with key players, but also set his messages to auto-delete.
Musk had originally claimed that he has not used Signal to discuss the Twitter deal with people like Jared Birchall, the financier who runs Musk’s family office.
Twitter lawyers argued that auto-deleted messages were the same as destroying evidence, and asked the Delaware court to place a “severe sanction” on Musk.
In a previous case where a party was found to have deleted electronic information, the Delaware Court of Chancery ordered it to pay the opposing side’s legal fees.
Musk’s U-turn comes after several of his text messages were made public last week. The communications were uncovered in discovery previous to the Twitter trial.
The texts include communications with other prominent tech founders, including Oracle cofounder Larry Ellison, Salesforce founder Marc Benioff, LinkedIn founder Reid Hoffman, FTX founder Sam Bankman-Fried, and Palantir cofounder Joe Lonsdale. The messages cover a period spanning from before Musk’s disclosure that he was Twitter’s largest shareholder, to when Twitter accepted Musk’s buyout offer.
The texts revealed the private communications of some of the wealthiest people in the world, as well as potentially embarassing conversations, like one between Musk and his ex-wife, actress Talulah Riley, complaining about “woke-ism,” or congratulatory messages from individuals like podcaster Joe Rogan.
Further communications uncovered in discovery might have been revealed if the hearing continued. On Monday, Judge Kathaleen McCormick allowed Twitter to review even more texts from Musk’s inner circle.
Musk was set to be deposed later this week, forcing the Tesla CEO to answer more questions under oath.
Worries about the upcoming deposition, due to start on Thursday, may be why Musk revived his offer on Tuesday. “What’s ultimately strange about [the offer] is that it’s the most predictable ending,” Ann Lipton, a professor of entrepreneurship at Tulane University, told The Verge. “Of course cases settle before the deposition of the top guy.”
Sign up for the Fortune Features email list so you don’t miss our biggest features, exclusive interviews, and investigations.