Tesla's stock is up by more than 16 percent in early Monday trading after Elon Musk signed a deal with the Securities and Exchange Commission over the weekend. Monday's gains erased Friday's 14-percent plunge after the SEC filed its lawsuit late on Thursday.

Musk's dispute with the SEC arose from an August 7 tweet in which Musk claimed to have "funding secured" to take the company private at $420 per share. But it quickly became clear that Musk's funding commitment—supposedly from Saudi Arabia's sovereign wealth fund—was informal at best. The SEC eventually sued Musk for securities fraud on Thursday. Musk initially vowed to fight the charges, but after Tesla's stock cratered on Friday, Musk backtracked and settled the case on Saturday.

While Musk technically capitulated to the SEC over the weekend, he signaled Monday morning that he has no intention of behaving himself in the future:

Naughty by Nature 😉https://t.co/muZdxJWjyZ — Elon Musk (@elonmusk) October 1, 2018

Musk's settlement with the SEC requires him to give up his position as chairman of Tesla's board for three years. Tesla will also be required to appoint two additional board members who are independent of Elon Musk. Musk will be able to continue as CEO, but the SEC's aim is to give Tesla's board more independence from Musk—and hence to subject Musk to more vigorous oversight.

Musk and Tesla must each pay $20 million in fines, which will be distributed to traders who were harmed by the tweets.

This weekend's legal drama came as Tesla was scrambling to wrap up its pivotal third quarter. Musk has said that he expected Tesla to achieve positive cash flow and profitability in the quarter, which ended on Sunday. Achieving those milestones would be a rebuke to many on Wall Street who have insisted that Tesla would need to raise additional funds in the coming months.

"One more hardcore weekend and we will all be victorious," Musk wrote on Friday in an email to employees. Later in the weekend, he added that "we are very close to achieving profitability and proving the naysayers wrong, but to be certain, we must execute really well" on Sunday.