Tesla Motors has trumped analysts' expectations and posted its first profit in eight quarters on the back of record car deliveries.
The electric carmaker said its net income for the third quarter ending 30 September was $21.9m (£17.9m). A year earlier, Tesla made a loss of $229,9m.
Tesla's revenue more than doubled, reaching $2.3bn. Analysts had been expecting revenue of $1.9bn.
Elon Musk, the billionaire chief executive of Tesla, said the company was planning to deliver 50,000 cars in the second half of 2016.
Musk added: "New product launches, increased store efficiency and new store openings drove year-on-year order growth in the third quarter, while self-driving hardware and other product enhancements position Tesla for additional market share gains.
"Our energy storage products are gaining increased market acceptance, firmly establishing Tesla as a leader in energy storage solutions and surpassing our competitors in the breadth and scope of our offerings."
The next challenge for Tesla will be bringing its mass-market car, the Model 3 sedan, to consumers in 2017. Musk announced last week that all new Tesla cars will have self-driving capability, and the same technology will be installed into the Model 3.
The car will be wired to eight cameras, giving it a 360 degree view, and it will also be equipped with 12 ultrasonic sensors to detect objects.