Elon Musk, Tesla’s CEO, has reached a deal with the US Securities and Exchange Commission to settle a dispute over his use of Twitter, according to a court filing on Friday.

Musk has agreed to submit public statements about the company’s finances to vetting by its legal counsel, the filing said.

If it is approved by a judge, the deal means the Tesla founder no longer faces the prospect of being held in contempt for violating an earlier settlement with the agency that required him to submit any of his public statements that would be material to investors for prior review.

The new agreement, disclosed in a filing in Manhattan federal court, lays out in more detail exactly what kinds of statements must be reviewed.

Shares of Tesla rose 1.4% to $238.50 in after hours trading following disclosure of the agreement, which lifts a cloud that has hung over Musk as Tesla tries to ramp up production of its most important vehicle, the Model 3 sedan, and make a profit at the same time.

The SEC sued Musk last year after he tweeted on 7 August that he had “funding secured” to take Tesla private at $420 a share. The agency said the tweet, which sent the electric automaker’s share price up as much as 13.3%, violated securities laws. Musk’s privatization plan was at best in an early stage and financing was not in place.

Musk settled the lawsuit, agreeing to step down as chairman and have the company’s lawyers pre-approve written communications, including tweets with material information about the company.

In February, the SEC accused Musk of violating that settlement by sending a tweet about Tesla’s production that had not been vetted by the company’s attorneys, and asked the US district judge Alison Nathan in Manhattan to hold him in contempt.

Musk’s lawyers have argued that the tweet did not contain new information that was material to investors, and that Musk did not need pre-approval for all tweets about Tesla under the settlement.

At a court hearing on 4 April, a lawyer for the SEC said that if Musk were found in contempt, the agency would ask the judge to require him to submit regular reports about his Twitter use, and to pay a series of progressively higher fines for any future violations.

Nathan declined to rule on the contempt motion at the hearing, instead ordering Musk and Tesla to meet and try to resolve the dispute on their own.