Elon Musk, the CEO of Tesla, sold $6.9 billion worth of company shares, claiming the money could be used to finance a potential merger with Twitter if he loses a legal dispute with the social media platform.

The billionaire, who agreed to purchase Twitter in April for approximately $44 billion, or $54.20 per share, is currently engaged in a contentious legal dispute with the social media powerhouse.

“In the (hopefully unlikely) event that Twitter forces this deal to close and some equity partners don’t come through, it is important to avoid an emergency sale of Tesla stock,” Musk tweeted late Tuesday after the sales were revealed in a number of regulatory filings.

Also Read| Why Elon Musk sold Tesla shares worth $6.9 billion

According to Charu Chanana, a strategist at Saxo Capital Markets Pte in Singapore, Musk is “cashing up for Twitter” and may be looking to profit from the roughly 35% rise in Tesla stock since late May. “The bear market rally has begun to sputter, and further downgrading of Fed expectations could spell more trouble for equities in the near future, especially in tech.”

According to the new filings, Musk sold approximately 7.92 million shares on August 5. The sale comes just four months after the Tesla CEO said he had no plans to sell more Tesla stock after selling $8.5 billion in the aftermath of his initial offer to buy Twitter.

Musk announced last month that he was terminating the agreement to buy and take private the social network where he has more than 102 million followers, claiming the company had made “misleading representations” about the number of spam bots on the service. Twitter has since sued to compel Musk to complete the transaction, and a trial in Delaware Chancery Court has been scheduled for October.

According to the Bloomberg Billionaires Index, Musk is the richest person in the world with a fortune of $250.2 billion; however, as Tesla share prices have fallen this year, Musk’s fortune has decreased by about $20 billion.

Also Read| Snapchat setting stage to lay off employees

Musk abandoned his plans to use a margin loan secured by his Tesla stake to partially finance the purchase in May and increased the equity portion of the deal to $33.5 billion. He had previously disclosed that he had received equity commitments totaling $7.1 billion from investors such as Sequoia Capital, Binance, and billionaire Larry Ellison.

The deal “should proceed on original terms,” Musk wrote in a tweet over the weekend, “if Twitter provides its method of sampling accounts to determine the number of bots and how they are confirmed to be real.”

Also Read| Tata Chemicals share surges 12% as PAT rises 87% YoY in June quarter

Over the last ten months, Musk has sold stock in Tesla valued at about $32 billion. The disposals began in November after Musk, a frequent Twitter user, asked the site’s audience whether he ought to reduce his stake. The latest sales’ motivation was not immediately apparent.

Although they are still down about 20% for the year, Tesla shares have increased by about 35% from recent lows hit in May.