Tesla founder and CEO Elon Musk is no stranger to attracting attention -- both good and bad -- for how he uses Twitter, but now he is going to court for it. Only now, Musk is litigating to stop what he says is an assault on his free speech by government regulators.

On Thursday, lawyers for Tesla filed a lawsuit against the Securities & Exchange Commission (SEC) that accused the agency of trying to muzzle Musk. Specifically, they allege that regulators are harassing Musk because of his Twitter posts, several of which have been critical of the policies pursued by the Biden administration.

“The SEC seems to be targeting Mr. Musk and Tesla for unrelenting investigation largely because Mr. Musk remains an outspoken critic of the government,” Alex Spiro, a lawyer for Musk and Tesla, said in the new filing. "The SEC’s outsized efforts seem calculated to chill his exercise of First Amendment rights rather than to enforce generally applicable laws in evenhanded fashion.”

Tesla’s lawsuit appears aimed at achieving two goals: an end to a “preclearance” deal struck with the SEC in 2018, and the distribution of $40 million in funds to Tesla shareholders that the company says it has never received.

The deal struck in 2018 followed an outcry from shareholders after Musk tweeted that he had secured funding to return Tesla to being a private company over a publicly traded one. The SEC alleged that Musk’s statements were not truthful and it sued the company for the nearly $40 million in losses incurred by shareholders. These are the funds that the company today says have yet to be doled out by the government.

As part of the deal, Tesla’s lawyers agreed that they would monitor Musk’s tweets and preclear them to avoid a repeat of the 2018 incident. This did not stop Musk from tweeting on May 1, 2020, that he felt “Tesla’s stock price is too high imo,” using an abbreviation for “in my opinion.” Tesla’s shares sank after the tweet, but a federal judge prevented a lawsuit from going forward.

Musk has been a notable critic of the proposed tax policies of President Joe Biden and Senate Democrats. Last year, he got into a vulgar Twitter exchange with Senate Finance Committee Chairman Ron Wyden, D-Ore., Elizabeth Warren, D-Mass., and Bernie Sanders, I-Vt., for their advocacy of higher taxes on billionaires like himself. He has also tweeted rude remarks about Biden and retweeted a petition calling on Biden to publicly praise Tesla for its role in the electric vehicle market.