A federal judge has approved the settlement between Tesla chief executive Elon Musk and the Securities and Exchange Commission.

The Washington Post reports that U.S. Judge Alison Nathan of the U.S. District Court for the Southern District of New York signed orders confirming the settlements. This came despite concerns from some industry observers that Musk’s tweet mocking the SEC may have harmed chances of the settlement being approved.

The settlement will require Musk to pay $20 million in fines to the SEC for his tweet about having funding secured to take Tesla private. Additionally, he will be required to relinquish his role as Tesla chairman for at least three years within 45 days. Tesla itself will also have to pay a $20 million fine.

The SEC wanted to ban Musk from being in charge of a public company

Additionally, Tesla’s board must appoint an independent chairman and directors without direct ties to Musk. The electric automaker must also closely watch the communications of their outspoken chief executive with investors, including his liberal use of Twitter.

Musk wasn’t required to admit wrongdoing under the settlement.

According to Jay Dubow, a partner at law firm Pepper Hamilton, the settlement isn’t that bad for Musk after all.

“The SEC got a lot of publicity and a lot of money in the scheme of things, for them, but I think most people will conclude he really won this battle,” he told CNBC.

Musk caused massive controversy in August when he tweeted he had secured funding to take Tesla private at $420 a share. Following a backlash from investors, Musk decided keeping Tesla public was the best way forward.