Tesla posted a profit in the third quarter this year, helping its embattled CEO Elon Musk come through on his promise for the company to get in the black.
The company earned $312 million in the last three months, putting its cash flow in the black for the first time since 2016.
Overall, Tesla logged $6.8 billion in revenue, exceeding analysts' predictions. The figure is double Tesla’s revenue from the same quarter last year.
The improved earnings follow Tesla’s ramped-up production of its most affordable car, the Model 3, which retails for roughly $46,000.
The company also said that under 20 percent of its roughly 450,000 preorders for the car have been canceled. The company has delayed the sedan's release multiple times.
Tesla's stock price shot up by more than 10 percent in after-hours trading on Wednesday following the release of the new numbers.
The earnings come as a bright spot amid a difficult year for Musk.
The Tesla CEO has dealt with several controversies recently, including over tweets he sent in August about taking the company private at $420 a share.
The tweet triggered a federal investigation that ended with Tesla paying a $20 million settlement.
Musk also garnered controversy when he baselessly accused a man on the team tasked with saving the Malaysian boys trapped in a cave of being a pedophile.