Tesla shares are up almost a fifth in after-hours trading after the 'leccy car maker posted a surprising profit for the third quarter.

Financial analysts were increasingly losing patience with the company, which lost over $1bn in the first half of the year and struggled to control costs while also solving the real-world difficulties of building efficient production lines. But for the three months ended 30 September 2019, Tesla claimed gross margins of 4.1 per cent.

Although revenues were down slightly on predictions at $6.3bn, compared to $6.5bn, profits were three times even the most optimistic forecasts at $143m.

Tesla blamed the drop in revenue on a tripling of leased vehicles compared to the same period last year.

There was also good news on the factory building front in Shanghai, China, which was described as ahead of schedule and trialling production. Tesla is still waiting for final licensing and government sign-off.

CEO Elon Musk said the factory had produced four vehicles and that building the facility had created a template that could be followed in Europe. Musk promised to announce the new European factory's location before the end of the year.

This could prove a big boost for Tesla – the Chinese market dwarfs that of the US and Europe, with electric cars sales topping 350,000, 7 per cent of total car sales, in the second quarter of 2019. Locally made cars also benefit from zero tax.

Aside from cars, Tesla's solar panel business deployed 43MW in the quarter, up from 29MW last quarter, but half the 93MW deployed during the same period last year. Storage deployed was 477MWh, up from 415MWh last quarter and 240MWh in Q3 2018.

The Model Y is also ahead of schedule and should be ready by summer 2020. Musk said he expected the Y to outsell the Models S, X and 3 combined.

There was also progress in Tesla's autonomous driving. The Smart Summon feature, which allows cars to be "summoned" from 200ft away, was rolled out in September and has already been used "more than one million times".

This technology powers the most optimistic fans' dreams because it could give Tesla owners the chance to hire out their vehicles as Johnny Cabs when they're not using them, or more likely give Tesla the opportunity to not just sell cars, but transport too.

Musk said it was going to be tight "but it appears to be on track for at least an early access release of a fully functional Full Self-Driving by the end of this year".

The earnings call transcript is available here. ®