Tesla reported a surprise third-quarter profit of $2.90 per share on Wednesday.

Shares spiked as much as 10% in after-hours trading following the release.

Watch Tesla trade in real time here.

Tesla reported a surprise third-quarter profit on Wednesday that easily surpassed Wall Street's expectations.

Here are the important numbers:

Adjusted earnings: $2.90 per share versus -$0.15 expected.

$2.90 per share versus -$0.15 expected. Revenue: $6.8 billion versus $6.3 billion expected.

"Q3 2018 was a truly historic quarter for Tesla," the company said in a press release. "Model 3 was the best-selling car in the US in terms of revenue and the 5th best-selling car in terms of volume."

Free cash flow was $881 million for the quarter, the company said. Total long-term debt also increased slightly, to $9.67 billion.

Tesla said that it produced an average of 4,300 Model 3s a week during the quarter — still below its previous target of 5,000 a week — and that it was accelerating plans to manufacture the sedans in China "in order to significantly increase the affordability." Those vehicles will be only for Chinese customers, it said.

The high price of the Model 3 helped increase Tesla's gross automotive margin to above 25% from 20% in the previous quarter, but tariffs from President Donald Trump's ongoing trade war could take a bite out of its margins, the company said.

"Gross margin for Model S and X will likely decline slightly in Q4, as we expect that the sequential increase in tariffs in Q4 from Chinese sourced components will be only partially offset by increased manufacturing cost efficiencies," Tesla said. "For all three vehicles, additional tariffs in Q4 on parts sourced from China will impact our gross profit negatively by roughly $50 million."

Shares of Tesla were gunning for massive gains Thursday morning, after climbing more than 10% in after-hours trading following the release.

More from Tesla's third-quarter earnings: