SAN FRANCISCO — Elon Musk is taunting the government regulators who threatened to oust him as CEO of electric carmaker Tesla just days after he settled a case alleging he duped investors.

Musk jabbed the Securities and Exchange Commission on his Twitter account, the same agency that went after him for an August 7 tweet in which he declared he had secured financing for a Tesla buyout. The SEC alleged that Musk hadn’t locked up the estimated $25 billion to $50 billion that it would have required to pull off that deal, and wanted to punish him by forcing him out as Tesla’s CEO.

After initially rejecting an SEC offer to settle the case, Musk relented two days after the fraud complaint against him and agreed to resolve the matter by having Tesla and Musk each pay a $20 million penalty, stepping down as Tesla’s chairman and submitting to oversight about his communications about company news.

But the deal didn’t prevent the free-wheeling Musk from continuing to speak out about other subjects — a liberty he took advantage of to bash the SEC in a Thursday tweet that indicated he is still stewing about the allegations filed against him.

Musk derided the SEC as the “Shortseller Enrichment Commission” before snidely praising it for “doing incredible work.”

The tweet also stoked Musk’s long-running feud with short sellers, a category of investors that have been betting on Tesla’s stock to fall.

Tesla shares declined by more than 2 percent to $274.50 in extended trading after Musk’s tweet.

The SEC declined to comment on Musk’s tweet. Tesla didn’t immediately respond to requests for comment.

Musk’s barb at the SEC doesn’t violate the settlement because he didn’t explicitly criticize as it as being unfair or unwarranted, said Peter Henning, a Wayne State law professor who was formerly an SEC attorney.

“But it certainly shows his pique at having to settle,” Henning said. “This isn’t something you would expect from a mature corporate leader, but he is clearly still angry and was probably reluctant to settle.”

The SEC settlement still needs court approval. U.S. District Judge Alison Nathan on Thursday ordered the SEC, Musk and Tesla to filed documents by Oct. 11 explaining why the agreement is “fair and reasonable.”

Musk, 47, has rarely seemed hesitant to make provocative statements to his more than 22 million followers on Twitter. He is now defending himself against a defamation lawsuit filed by a diver who helped save 12 boys on a Thai soccer team from a flooded cave. Musk described the diver as a pedophile in a tweet that has since been deleted.

As part of Musk’s settlement with the SEC, Tesla is supposed to monitor its CEO’s Twitter posts, but only those that have to do with company news. But that doesn’t mean Tesla’s board can’t order Musk to tone done his Twitter act in the best interests of the company.

“Someone has to get a hold of his Twitter account and stop him,” Henning said.