Electric-carmaker Tesla reported a quarterly profit on Wednesday, sending its shares higher and providing a measure of at least temporary vindication to embattled CEO Elon Musk.
Musk had said that Tesla would generate positive cash flow in the second half of this year, though some investors had expressed doubts, pointing to a tumultuous few months in which the billionaire's use of Twitter led to legal trouble.
Tesla reported profit, or net income, of $312 million in the three months that ended Sept. 30, compared with a loss of $619 million in the same quarter a year earlier.
Shares rose more than 12 percent in after-hours trading.
The results may have an impact on fears among some Tesla investors that the company would need to seek an infusion of cash in the near future by selling either bonds or otherwise in order to continue operations. Musk has said his company won't need to raise money.
Tesla reported free cash flow of $881 million and an increase in cash or cash equivalents at its disposal.
Tesla generated $6.82 billion in revenue. Analysts on average had expected $6.33 billion, according to research firm Refinitiv.
Doubts about Musk's leadership of Tesla grew after he posted a series of tweets in which he said he was considering taking Tesla private and had "funding secured." His settlement of a lawsuit over the matter with the Securities and Exchange Commission requires that he step down as Tesla's chairman, though he will remain as CEO.
Separately, a British diver has sued Musk for defamation over tweets Musk wrote.
Tesla in a letter to shareholders called it a "truly historic quarter" and reiterated that it expected to be profitable in the fourth quarter of the year, as well.