Tesla CEO Elon Musk sold $6.9 billion worth of Tesla stock, explaining on Tuesday that the money was needed in the event that a deal to buy Twitter was forced upon him if he lost his legal case with the tech giant. “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. Musk backed out of the agreement to purchase Twitter for $44 billion in July citing allegations surrounding spam accounts on its platform. Twitter responded by suing Musk to force the completion of the deal, countering that his claims about fake accounts were untrue. The two parties will take their case to court on October 17. Related articles: Trump tells Cabinet Elon Musk will resign from govt. soon Elon Musk to investigate how Representatives became so wealthy What was leaked from the US Department of Defense? Swasika painted on Tesla truck owned by Jewish man Musk also said on Twitter on Tuesday that he would repurchase Tesla stock if the Twitter deal does not take place. Musk sold off 7.92 million shares of Tesla between August 5 and 9, according to Reuters . The billionaire currently owns 155.04 million shares, slightly less than 15 percent of the electric vehicle company. Musk also joked on Tuesday that he might create his own social media platform. Replying to a Twitter user’s question on the topic, Musk said if the deal with Twitter does not happen, he will create “X.com.” In March, Musk told the Wall Street Journal that he was “giving serious thought” to creating his own social media platform, but he didn’t give any further details.