Tesla stocks are up after the company's settlement with the SEC. Chicago Engineer and tech entrepreneur Elon Musk of The Boring Company talks about constructing a high speed transit tunnel at Block 37 during a news conference on June 14, 2018 in Chicago, Illinois. Joshua Lott/Getty Images

One of Tesla’s (TSLA) biggest self-inflicted scandals reached its conclusion on Friday, prompting investors to express renewed confidence in the firm Monday. Shares of Tesla opened with big gains, as enigmatic CEO Elon Musk, who stepped down as chairman of the company, stressed the importance of persistence to his employees.

Tesla shares surged more than 17 percent at one point in the hours after markets opened on Monday after Musk agreed to a settlement with the Securities and Exchange Commission on Saturday. The federal agency had sued Tesla on Thursday for the August announcement that the electric car manufacturer would go private at $420 per share.

According to the commission, Musk’s Aug. 7 tweet announcing the news was premature and misleading to investors. Shares of Tesla jumped in the immediate aftermath of the announcement, but came back down in the weeks after, as it became clear the electric automaker did not actually have funding. Tesla’s share price ended Friday down nearly 15 percent in the wake of the SEC lawsuit.

The lawsuit was the culmination of nearly two months of investigation by the SEC. Per the terms of the settlement, Musk announced he would step down as chairman and pay $20 million. Tesla will also pay the same fine.

Tesla will publish its third-quarter earnings report this week. As such, Musk told employees over the weekend in emails obtained by CNBC to minimize distractions. Tesla has yet to become profitable, but Musk told employees the company was close to that dream before the quarter ended on Sunday.

“We are very close to achieving profitability and proving the naysayers wrong, but to be certain, we must execute really well tomorrow (Sunday),” Musk wrote, per CNBC. “If we go all out tomorrow, we will achieve an epic victory beyond all expectations.”

Musk has received public attention in recent months for his comments on social media. The company’s public image was hurt in recent months by Musk’s unsubstantiated claim that a man who helped save a youth soccer team from a Thailand cave system was a pedophile.