Elon Musk had a settlement agreed with the Securities and Exchange Commission (SEC) but blew it up at the eleventh hour, The Wall Street Journal reports.

The SEC is suing Musk and seeking to bar him from being an officer or director at any public company.

The suit revolves around Musk's now infamous "funding secured" tweet in August when he toyed with the idea of taking Tesla private.

Elon Musk agreed on a settlement with the Securities and Exchange Commission (SEC), but walked away from the deal at the eleventh hour last week.

That's according to a report in The Wall Street Journal, which said the SEC was on the brink of filing the settlement, only for Musk to blow it up at the last minute.

CNBC reported on Friday that the proposed settlement would have barred Musk from being the chairman of Tesla's board of directors for two years, forced Tesla to add two new independent directors to the board, and required Musk and Tesla to pay a fine. Musk wouldn't accept the deal because he believed that doing so "would not be truthful to himself," according to CNBC.

That chain of events led to the SEC announcing on Thursday that it was suing Musk on charges he made "false and misleading statements" in tweets claiming he could take the company private.

The Journal said the SEC had "crafted" the settlement with Musk. It was preparing to file the agreement on Thursday last week, but then Musk's lawyers called to spike the deal. The SEC then hastily pulled together a lawsuit.

The SEC is suing the Tesla CEO for his now infamous "funding secured" tweet from August 7, which purported he was taking Tesla private at $420 a share. The SEC said Musk knew such a deal was never on the table. He announced on August 25 that Tesla would remain public.

In its claims for relief, the SEC recommended that Musk pay a penalty and that he be "prohibited from acting as an officer or director" of a public company.

Musk said he was "deeply saddened" by the lawsuit. In a statement, the Tesla CEO said: "The unjustified action from the SEC leaves me deeply saddened and disappointed. I have always taken action in the best interest of the truth, transparency and investors. Integrity is the most important value in my life and the facts show I have never compromised this in any way."

The SEC declined to comment when contacted by Business Insider. A Tesla spokeswoman said: "Tesla and the board of directors are fully confident in Elon, his integrity, and his leadership of the company, which has resulted in the most successful US auto company in over a century. Our focus remains on the continued ramp of Model 3 production and delivering for our customers, shareholders and employees."

The SEC lawsuit caused Tesla's stock to dip by as much as 11% in after-hours trading.