Elon Musk has reached a settlement with federal regulators, which had sued him on Thursday for making misleading material statements. He will get to remain as Tesla's CEO, but must step down as chairman.

The bottom line: This is a smart decision for both Musk and Tesla, as a drawn-out court case would have clouded both of their futures for months to come.

The background: Musk got into hot water for tweets related to his efforts to take Tesla private, particularly claiming that he had "funding secured" at $420 per share, even though the SEC claims he never discussed that specific price with prospective investors.

Musk reportedly had been ready to settle with the SEC last week, but then backed out of the deal because he felt the charges were unjustified.

The SEC responded with a lawsuit, which could have resulted in him being barred from serving as an officer or director of any public company for years.

Tesla has been struggling to show it can sustainably continue expanding production of the Model 3 sedan that’s critical to the company’s future.

Settlement details: Musk gets to remain as CEO, but within 45 days must step down as chairman for a period of three years. He also must pay a $20 million penalty, and comply with new company procedures for any future communications related to Tesla, including via his Twitter account.

Musk neither admits nor denies the allegations brought forth by the SEC.

Tesla, which was not a defendant in Tuesday's lawsuit, also will be required to pay a $20 million penalty, and add two new independent directors. Those details are included in a separate settlement from the one posted below, which is only with Musk.

Thought bubble: Kelly Blue Book executive analyst Rebecca Lindland writes, "A new chairman will also provide much needed guidance and the new board members governance to Tesla as a company and allow Elon to continue with his vision of changing the face of mobility."

Elon can’t just replace himself with a chairman of his choosing — the company has to appoint an independent chairman. Tesla has to hire a Securities Counsel whose job it will be to vet all Elon tweets before they go out.

Go deeper: Elon Musk throws a Tesla tantrum