Tesla and its CEO Elon Musk's settlement with the Securities and Exchange Commission has cleared its final hurdle.

The settlement has been approved by U.S. District Judge Alison Nathan in Manhattan

Bloomberg reported the agreement was made final in Manhattan on Tuesday.

The lawsuit stemmed from a tweet posted by Musk on August 7. The tweet claimed "funding secured" as Musk floated the idea of taking the Silicon Valley automaker private at $420 per share.

The settlement terms will have Tesla pay a $20 million fine, and Musk will pay a $20 million fine. Musk will also step down as chairman of the board for at least three years. Two new independent directors will be recruited to join Tesla's board of directors.

ALSO SEE: DOJ wants to know if Tesla CEO Elon Musk broke the law in going-private tweets

The $40 million in penalties will be distributed to investors via a court-approved process, which has yet to be detailed.

Days after the settlement was announced, but before it was approved by the judge, Musk trolled the SEC on Twitter.

The book on this chapter has closed with the SEC, but the repercussions from Musk's tweet about going private might not be over yet. The U.S. Department of Justice may be investigating Musk separately, but officials haven't confirmed the investigation.