Tesla CEO Elon Musk on Saturday settled a lawsuit with federal regulators alleging that the controversial executive bilked investors and lied when he announced the automaker had "funding secured" to buy back millions in shares to take the company private.

The Securities and Exchange Commission announced the settlement Saturday.

According to the public terms of the settlement, Musk and Tesla agreed to pay $40 million and step down as chairman of the board of Tesla for three years. Musk and Tesla do not have to admit wrongdoing as part of the settlement.

Regulators at the SEC said the settlement will put better safeguards in place at the electric-car company, although Musk will remain as CEO. Two new board of directors will be added as part of the settlement.

“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.

Tesla did not immediately comment on the settlement.

The settlement follows reports that Musk initially agreed to, then walked away from an SEC settlement that would have him removed as chairman of the automaker for two years.

It wasn't immediately clear if the settlement would put additional restrictions on what Musk could say publicly, especially on Twitter. An independent board will be tasked to oversee Musk's communications, but it wasn't immediately clear what that would mean for the controversial CEO.

On Aug. 7, Musk tweeted that the automaker had money to potentially execute one of the largest leveraged corporate buybacks in recent history.

Just a few weeks later, Tesla and Musk abandoned the bid, but didn't address rumors that Musk tweeted his claim without due diligence.

A separate, criminal investigation by the Justice Department may be ongoing, although federal officials haven't confirmed or denied that an investigation is underway.

This story is developing and will be updated.