New York (CNN Business) Investors cheered Tesla's deal with the SEC that keeps Elon Musk as CEO.

The stock surged 17% on Monday, more than wiping away Friday's loss.

Over the weekend, Musk agreed to a settlement with the SEC that requires him to step down as Tesla's chairman and pay a $20 million fine.

Under the settlement, which requires court approval, Musk will be allowed to stay as CEO but must leave his role as chairman of the board within 45 days. He cannot seek reelection for three years, according to court filings.

He accepted the deal "without admitting or denying the allegations of the complaint," according to a court document.

Read More