This is worth around $6.88bn (£5.7bn) and was reportedly done in anticipation of the outcome of the Twitter lawsuit the world’s richest person is embroiled in.
The sales took place after the firm’s annual shareholder meeting last week, regulatory filings show.
According to BBC News, Mr Musk says he needs the money in case he is forced to buy Twitter for $44bn.
The multi-billionaire is currently embroiled in a legal battle with the social media platform after saying last month he would pull out of a deal to buy it.
The latest transactions were carried out on August 5, 8 and 9, according to six filings with the US Securities and Exchange Commission.
After news of the share sale was made public, Mr Musk responded to a tweet asking whether he had finished selling Tesla shares with “yes”, adding that he needed the money in case he was forced to buy Twitter and was unable to secure some of the funding for the deal.
“It is important to avoid an emergency sale of Tesla stock,” he said.
Asked by another user whether he would buy Tesla shares again if the Twitter takeover does not take place, Mr Musk also responded with “yes”.
In July, Mr Musk said he planned to walk away from his bid to buy Twitter, prompting the company to sue him.
Twitter said Musk refused to honour his obligations to Twitter and its stockholders because the deal “he signed no longer serves his personal interests.”
The world’s richest person has accused the company of withholding information about fake accounts.
Last month, a US judge ruled that Twitter’s lawsuit against Mr Musk should go to trial in October.
Twitter hopes that the court will order Mr Musk to complete the takeover at the agreed price of $54.20 per share.
Mr Musk has countersued Twitter, although the details of that lawsuit have not been made public.
Also in July, Twitter said that between April and June, it had spent $33m on the proposed deal.
It also said its number of monthly daily users had risen to 237m – but it reported a net loss of $270m, which was worse than expected.