The CEO said he may need the money if he's forced to go through with the purchase of Twitter.

In early June, Musk tore up his April 25 agreement to buy the social media platform for $44 billion.

Twitter has since sued Musk to force him to complete the transaction, dismissing his claim that he was misled about the number of spam accounts.

The two sides are set to head to trial in October.

In a Tweet on Tuesday, Musk said:

"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 added that he would buy the Tesla stock again if the Twitter deal does not close.

Tesla shares have risen nearly 15% since the automaker reported better-than-expected earnings on July 20.