(Reuters) — Tesla Chief Executive Elon Musk has reached a deal with the U.S. Securities and Exchange Commission to settle a dispute over Musk’s 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 percent 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 Aug. 7 that he had “funding secured” to take Tesla private at $420 per share. The agency said the tweet, which sent the electric automaker’s share price up as much as 13.3 percent, 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 U.S. 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 an April 4 court hearing, 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.