Elon Musk is finally facing some consequences for his August take-Tesla-private dance. The South African–born billionaire will step down as chair of the electric car company and pay a $20 million fine as part of a settlement with the Securities and Exchange Commission. The SEC had sued Musk on Thursday after he reportedly turned down an initial deal at the last minute.

As part of the new agreement announced on Saturday settling the SEC’s suit, Musk will resign as Tesla chair within 45 days, and he won’t be able to be reelected to the post for three years. Musk and Tesla will each pay a separate $20 million penalty, which will be distributed to harmed investors, and Tesla will appoint two new independent directors to its board. A judge will have to approve the settlement.

Tesla will also hire a lawyer to keep an eye on Musk’s communications as part of the settlement because, the SEC alleges, the company failed “to implement disclosure controls or procedures” related to the CEO’s Twitter activity. In other words, Musk is getting a Twitter babysitter.

This — at least for now — brings to a close a dramatic chapter for Tesla that was ignited when Musk tweeted on August 7 that he was considering taking Tesla private at $420 per share and had already secured funding. It wasn’t clear how much groundwork had actually been laid for such a maneuver, and it’s illegal for companies and executives to give shareholders misleading information about potentially meaningful corporate events. The tweets were the basis of the SEC’s lawsuit against Musk for securities fraud.

Shareholders could either to sell at 420 or hold shares & go private — Elon Musk (@elonmusk) August 7, 2018

As part of Musk’s settlement, he is not allowed to “admit or deny” whether he did indeed commit securities fraud with his tweets. (He ultimately decided to keep Tesla public.) The New York Times reported on Friday that this specific feature of the agreement had been the initial deal breaker for Musk. The agency and his lawyers reportedly had this set to go on Thursday, but at the last minute, he backed out.

“The resolution is intended to prevent further market disruption and harm to Tesla’s shareholders,” Steven Peikin, co-director of the SEC’s enforcement division, said in a statement on Saturday.

The Department of Justice is also probing Musk’s privatization tweets. The SEC’s settlement with Musk states that it does not address any potential criminal liability.

A Tesla spokesperson did not immediately return a request for comment on the settlement.

The idea that Elon Musk shouldn’t be both chair and CEO of Tesla isn’t a new one

Musk has seemed almost untouchable at Tesla, despite his public missteps and erratic behavior and the company’s own problems related to production and cash burn. (Tesla had $2.2 billion in cash as of the end of June and says it expects the cash pile to grow going forward; the Times notes that Tesla uses about $1 billion each quarter and has $11 billion in debt.)

There have been doubts for quite some time as to whether Tesla’s board of directors would act to improve the situation.

Tesla’s board is filled with many Musk allies, including his own brother, and it has stood by him up to this point. A shareholder vote to remove him as chair failed earlier this year, and Tesla’s complex setup gives Musk outsized control of the company. Because of the “cult of personality” around Musk, there were concerns that ousting him — even with his unpredictable nature — would do more harm than good.

Garrett Nelson, a senior equity analyst at research investment firm CFRA Research, told me before the SEC’s lawsuit that it’s “impossible” to quantify the value of Musk’s persistence as CEO and chair of Tesla in its stock price.

“I would say that there’s an Elon Musk premium in the stock,” he said. “But as he is increasingly doing these erratic things, though, I think you’re seeing more and more shareholders kind of shift their attitudes as far as, strategically, what would make sense for the company going forward, and what his role is there.”

Removing Musk as chair while leaving him on as CEO could be good for Tesla. The company’s stock price fell by 14 percent on Friday; it’s not clear how investors will react when the markets open back up on Monday morning.