Tech giant Elon Musk is resigning as Tesla’s chairman but will remain as CEO after he settled charges with the Securities and Exchange Commission.

The SEC settled charges with Musk over his aborted bid to take the company private. Last month, Musk announced via Twitter that he had secured enough funding for a massive buyout of Tesla. The original SEC complaint alleged that Musk issued “false and misleading” statements, and failed to properly notify regulators of material company events.

As part of the settlement, which is still subject to court approval, Musk will also pay a civil penalty of $20 million and give up his role as chairman of the board for at least three years. Additionally, the SEC imposed a $20 million fine on Tesla, which will also be expected to appoint two new independent directors to the board.

Musk’s prolific use of Twitter has created several high-profile headaches for him personally, as well as the company he founded. In settling the charges, regulators faulted Tesla for not exerting more control over Musk’s tweeting.

“The SEC also today charged Tesla with failing to have required disclosure controls and procedures relating to Musk’s tweets, a charge that Tesla has agreed to settle,” the agency said in a statement.

“The settlements, which are subject to court approval, will result in comprehensive corporate governance and other reforms at Tesla—including Musk’s removal as Chairman of the Tesla board—and the payment by Musk and Tesla of financial penalties,” it added.