A US judge approved Tesla and chief executive Elon Musk’s $40 million (about €36 million) settlement with the US Securities and Exchange Commission, resolving a dispute over government claims that Mr Musk misled the public with a flurry of tweets about a plan to take the company private.

US district judge Alison Nathan signed off on the accord Tuesday after the electric-car maker, Mr Musk and the regulatory agency said in a detailed joint filing that the deal was in the best interest of investors.

The company will pay $20 million and Mr Musk will also pay $20 million.

The judge’s decision was largely expected, even after Mr Musk muddled the process by insulting the SEC in a series of tweets just a few days after reaching the deal.

The ruling allows Tesla to resolve an unwelcome distraction as its core business of making electric vehicles is improving. The company hit its targets for production and deliveries in the third-quarter, as the Model 3 sedan climbed the ranks of the top-selling cars in the US market. Total output of the model probably exceeded 100,000 last week, according to Bloomberg’s tracker.

Tesla rose 4.2 per cent in morning trading in New York.

Judy Burns, an SEC spokeswoman, didn’t immediately respond to a request for comment.

The SEC inquiry was triggered by Mr Musk’s August 7th tweet that he had “funding secured” to take Tesla private.

Its shares surged as much as 13 per cent after the tweet, and trading was temporarily halted. But within hours, questions began to swirl around Mr Musk’s claims, and the SEC quickly opened an investigation.

The agency moved with unusual speed, questioning Mr Musk, Tesla’s board and other executives.

Mr Musk and Tesla agreed to resolve the inquiry without admitting or denying wrongdoing. The accord called for their combined $40 million in penalties to be distributed to harmed shareholders through a court-approved process, the SEC has said.

The deal also calls for a new chairman to be appointed to Tesla, and the naming of two new independent directors.

Within days of the settlement, Mr Musk shot off a tweet referring to the SEC as the “Shortseller Enrichment Commission” and sarcastically praising the regulator’s work. Experts said the tweet could be viewed, problematically, as a denial of wrongdoing by Musk, but they said it wasn’t likely to derail the deal. – Bloomberg