Tesla last night posted a second-quarter profit as cost cuts and strong deliveries helped offset coronavirus-related factory shutdowns.
This sent its stock up 4.4% in after-hours trading on Wall Street as it cleared a hurdle that could lead to the electric carmaker's inclusion in the S&P 500 index .
Tesla said it earned net income of $104m from April to June, or $0.50 per share.
This marked the first time the company has posted a profit for four quarters in a row - a condition for it to be considered for the stock index of the largest US companies.
The performance is a major accomplishment for chief executive Elon Musk, whose mission of leading the global auto industry into an electric future has frequently been questioned by investors who doubted Tesla's viability.
Tesla's shares have gained more than 500% over the past year.
Many analysts believe the rally has been fueled in part by expectations of Tesla's imminent inclusion in the stock index, which would unleash a flood of demand for shares.
Musk on a conference call said Tesla would prioritise growth over profit going forward and focus on making its vehicles more affordable.
"The thing that bugs me most right now is that our cars are not affordable enough, we need to fix that," Musk said on the call. "I think we just want to be like slightly profitable and maximize growth and make the cars as affordable as possible."
Musk also announced that Travis County, Texas, which includes Austin, would be the site of Tesla's new factory.
The area had been competing with Tulsa, Oklahoma, for the new plant, which promises to create at least 5,000 jobs.
Elon Musk said the factory would produce Model 3 and Model Y vehicles for the Eastern US, as well as a new semi-truck called the Tesla Semi and the carmaker's futuristic Cybertruck.
Tesla last night affirmed its goal to deliver at least half a million vehicles by the end of 2020 despite production interruptions, including the shutting of its California factory for nearly six weeks of the quarter on orders of local authorities due to Covid-19.
The company delivered more than 90,000 vehicles in the second quarter, surpassing analyst expectations.
"While achieving this goal has become more difficult, delivering half a million vehicles in 2020 remains our target," the company said.
Musk said that the real limitation to Tesla's growth is battery cell production at an affordable price, and said the company would expand its business with Panasonic and China's Contemporary Amperex Technology.
Tesla will introduce new low-cost, long-life batteries in its Model 3 sedan in China later this year or early next, Reuters reported previously.
Tesla's second-quarter revenue fell to $6.04 billion from $6.35 billion a year earlier, but surpassed analyst expectations for revenue of $5.37 billion, according to IBES data from Refinitiv.
Tesla reported $5.18 billion in second-quarter automotive revenue, but its share of income from regulatory credits - payments the company receives from other carmakers to offset emissions - increased to $428m from $354m in the first quarter.
That revenue could dry up as more manufacturers develop and sell electric cars, but many rivals are still focused on reaping the high profit margins from fuel-guzzling trucks and SUVs.
Tesla's rapid rise to become the world's most valuable carmaker could mark the start of a new era for the global auto industry, defined by a Silicon Valley approach to software that is overtaking old-school manufacturing know-how.
The company said higher income from those regulatory credits in combination with temporary employee salary cuts during the pandemic and $48m in deferred revenue from its yet-to-be-released self-driving feature offset the cost of factory shutdowns.
Elon Musk this week qualified for a payout worth an unprecedented $2.1 billion, his second jackpot since May from the electric car maker following its massive stock surge.