The Tesla Model 3 is leading the electric car specialist's sales surge.

PALO ALTO, CALIFORNIA - Tesla surprised investors this week by posting a profitable third quarter, boosted by record deliveries, cost cuts and improved production schedules for its latest range of compact electric vehicles, causing shares to soar in after-market trading.

Shares rose nearly 21% after the company posted a cash balance increase to $5.3 billion (R77.3bn). The carmaker reported a profit of $1.86 per share, shattering analyst expectations for a loss of 42 cents per share.

The third-quarter results are an important milestone for Tesla and redemption for Chief Executive Elon Musk, who had to step down as chairman after a series of scandals and investor doubts about Tesla's ability to withstand competition from larger, better capitalised global rivals.

WATCH: 

Video by: Chelsea Lotz, Business Report TV

Tesla's gross margins, an important profit indicator for investors, surpassed expectations and Tesla said it was "highly confident" in exceeding the low end of its yearly global vehicle delivery goal.

The carmaker said it had cut costs 16% on a yearly basis, citing improvements in operating efficiency and a reduction in manufacturing and material costs. Musk said on a conference call that operating costs were the lowest since Model 3 production started.

Margin expectations are higher for Model Y than Model 3, while productions costs are roughly the same as Model 3, said Zach Kirkhorn, Tesla chief financial officer.

Model 3 vehicles made in the Shanghai factory will have roughly the same margins as those made in Fremont, California, he said.

Tesla also expects to generally be cash flow positive as it has grown to the point of being self-funding. 

That will allow the company to invest in divisions focusing on sustainable energy, including launching its third version of its solar roof tile this week.

"For about a year and a half we stripped Tesla energy of resources," Musk said. "Now that Model 3 production is in a good place and headed to a great place we have restored resources to Tesla storage and solar. That's going to be really crazy growth."

Musk also said Tesla is open to supplying batteries and other components to other carmakers.

With Wednesday's after-hours surge, Tesla's stock has reduced its loss year-to-date to 8% and added about $9 billion (R131bn) to its market capitalisation.

But Tesla rallies have been short-lived before.

A year ago, Tesla gave a quarterly report that similarly smashed investors' expectations, igniting a rally that sent its shares 31% higher over the next two months, only to see the stock decline through much of 2019 over worries about corporate governance, profitability and demand for the Model 3. 

Investors in the past have shown impatience with the company's serial failures to meet financial and production targets. Earlier this month, Tesla shares slumped after the company reported delivering 97 000 vehicles for the third quarter, just short of analysts' forecasts and only 2% ahead of the previous quarter.

But Tesla on Wednesday exceeded promises by billionaire Musk, who in July said Tesla would break even in the third quarter and turn a profit by the end of 2019.

The company has said it plans to deliver 360 000 to 400 000 vehicles for all of 2019, and on Wednesday said it was "highly confident in exceeding 360 000 deliveries this year."

Analysts have questioned how rapidly Tesla's vehicle sales will grow as government subsidies for electric vehicle purchases dwindle in the United States, China and other markets. US federal tax credits for Tesla vehicles were cut by half on July 1 and will disappear by the end of the year.

Tesla also said production of its new Model Y SUV and its Model 3 sedan at its factory in Shanghai were ahead of schedule. Model Y production is expected to launch by the summer of 2020, while production of full vehicles on a trial basis was already underway in Shanghai, Tesla said.

Tesla has said it aims to produce at least 1000 Model 3s a week at the new Chinese factory by the end of this year, but it is unclear when it will meet year-end production targets due to uncertainties around orders, labour and suppliers.

Besides working on its new Model Y and Shanghai factory, Tesla is also developing a gigafactory in Europe, a Semi truck, an electric pickup truck, a new generation of the Tesla Roadster and automated driving features.

Reuters