Elon Musk's tweets may have mocked the Securities and Exchange Commission, but his court filings are serious about settling the fraud charges that the SEC had lodged against him.

As recently as Oct. 4, Musk issued a sarcastic tweet, describing the agency as the “Shortseller Enrichment Commission,” despite having agreed to settlement terms a week earlier that his company, Tesla, would monitor his tweets and other communications.

However, on Thursday Musk and the SEC urged a federal judge to approve the terms of the proposed consent judgment that requires Musk to resign as Tesla’s chairman and personally pay a $20 million fine to the SEC. Tesla has to pay a separate $20 million fine, which the SEC said will be returned to investors.

The deal does not require Musk to admit that he misled investors when he tweeted about taking Tesla private in August at $420 a share. Musk later said the price was a reference to cannabis culture, which the entrepreneur thought would amuse his then-girlfriend, the musician Grimes.

“Tesla and Mr. Musk believe that a prompt resolution of these actions through settlement is in the best interest of investors and should be approved,” Tesla said in a statement within the joint filing Thursday.

The settlement also requires Musk to resign as Tesla's chairman for at least three years and for the company to appoint two independent board members. Musk will remain as CEO.

Terms of the settlement also require "implementation of mandatory procedures to oversee and preapprove Mr. Musk’s Tesla-related written communications that reasonably could contain information material to the company or its shareholders,” and goes on to demand an “experienced securities lawyer” who will enforce and approve Musk’s communications – including tweets.

Tesla made an SEC filing in 2013 that said Musk's tweets qualified as company disclosures. In the years since the filing, Musk has used Twitter to go on rants against short sellers, the media, and celebrities.