Tesla blew away expectations with just the third quarter of positive earnings in its history, bolstering Elon Musk’s bid to make selling electric cars a financially sustainable business.

The profit was by far its largest ever and sent Tesla's share price surging to levels last seen in mid-August, when the chief executive was still in the midst of a short-lived gambit to take the company private.

The stock sold off in the intervening months, after Mr Musk’s claim that he had “funding secured” for such a deal proved faulty and landed him in legal jeopardy.

All the while, Tesla was achieving long-awaited breakthroughs to boost production of its Model 3. Buyers — many of whom had been waiting more than two years to take delivery — quickly made it one of the top-selling sedans in the US.

Tesla is still far from being a full-line car manufacturer, and it’s followed up past quarters of profitability with strings of more losses. It’s still nowhere close to generating revenue and earnings to contend with the likes of Toyota or BMW. But even investors who’ve been among the most vocally bearish about the company have started to change their view as Mr Musk lures away buyers of Camry and 3-Series sedans.

“It is the most encouraging sign of sustainable profitability that we’ve seen in three years,” said Gene Munster, a managing partner at venture capital firm Loup Ventures. “Tesla did all of this despite the distractions around Elon himself, and the positive report reverses some of the damage that’s been done.”

Tesla reported adjusted net income of $2.90 (£2.25) a share, soundly beating analysts’ average estimate for a small loss.

Free cash flow was about $881m, a turnaround from the billions of dollars Tesla was burning on a quarterly basis while it was struggling to ramp up the Model 3.

And even as deliveries took off, Tesla managed to maintain more than $900m in customer deposits, showing that there’s still plenty of pent-up demand for the company’s cars.

Mr Musk capped the quarterly report with a drama-free earnings call, which is far from a given for him. He opened by calling on executives responsible for efforts ranging from artificial intelligence and Autopilot to workplace safety, leaving less time than usual for the question-and-answer session with analysts.

The quarter “marks an inflection point,” said Joe Dennison, associate portfolio manager of Zevenbergen Capital Investments in Seattle. Strong demand for pricier all-wheel-drive and high-performance versions of the Model 3, plus Tesla’s plan to start selling the car in Europe early next year, should support profit margins, he wrote in an email.

Tesla reaffirmed its forecast for profit and positive free cash flow in the fourth quarter, adding credibility to Mr Musk’s prediction a quarter ago that the company will make those feats routine going forward.

Mr Musk couched those comments in August by saying that “force majeure” events could prove him wrong. One such circumstance the company will have to muddle through in the coming quarters will be trade tensions involving China.

Support free-thinking journalism and attend Independent events

Higher tariffs have hit demand for Model S sedans and Model X crossovers imported into the country. Parts that Tesla sources from China and uses to build all of its vehicles in California are also being hit with higher levies, which will be a $50m blow to gross profit in the fourth quarter.

Tesla’s chief executive remains confident regardless.