Filings with the U.S. Securities and Exchange Commission (SEC) revealed on August 9 that the world's richest man, Elon Musk, has sold nearly $7 billion worth of Tesla (TSLA  ) stock, apparently in anticipation of a forced Twitter (TWTR  ) deal.

"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 wrote on Twitter on Tuesday.

In the same tweet, Musk wrote that he's done selling Tesla stock, and also responded "yes" to a question from a user asking if he plans on buying back the stock if he isn't stuck in the Twitter deal.

"The removal of the 'firesale' risk, the fact Musk has already raised cash in case of a Twitter decision going against him and the comment that he'll buy back stock if Twitter deal gets dropped all builds into a positive bias for Tesla," Mirabaud Securities sales trader Mark Taylor said.

At the electric carmaker's recent annual general meeting, CEO Musk referred to Tesla as a "buying opportunity". Just days later, Reuters reports that he sold roughly 7.92 million shares of the company, bringing his stake in the carmaker to 15%. In less than one year, Musk has made a total of $32 billion off Tesla share sales.

In April, Musk reported an $8.5 million sale of Tesla stock, saying that there were no more sales planned. However, that changed when Musk was faced with a legal challenge from Twitter. Twitter sued the tech billionaire in an attempt to force him to go through with the $44 billion acquisition deal he agreed to back in April.

Musk claims that he shouldn't be forced to carry out the deal because Twitter misled him about the number of spam accounts on the platform. For its part, Twitter has dismissed those allegations, arguing that Musk is trying to get out of the deal now because tech stocks have hit a downturn. However, Musk's recent sales may actually reduce the chances he'll be able to ditch the agreement.

"Elon's sale of (Tesla shares) over the past three days significantly increases odds the (Twitter) deal gets done, albeit at a slightly lower price $50-$51/share," managing partner Gary Black at Future Fund LLC wrote in a tweet.

A trial date for the suit was recently set for October 17.

Musk, a prolific Twitter user, also posted about Tesla's upcoming plans, saying that the company's high-end, long-range, battery-powered semi-trucks will start shipping this year. The semis have been in the works since 2017, and major companies have already made significant orders of the vehicles. However, the project was delayed until this year due to shortages of the 4680 battery cells.