Tesla shares soared Wednesday after the company posted its second profitable quarter ever and beat analyst expectations for the third quarter by a wide margin.

In a conference call Wednesday night, Tesla CEO Elon Musk said the company currently believes the fourth quarter will be profitable excluding non-cash stock-based expenses, and added there is a "chance" Tesla will be profitable even taking those things into account.



Tesla said it earned 71 cents a share on an adjusted basis in the third quarter on $2.3 billion in revenue. Analysts expected a loss of 54 cents per share on $1.98 billion in revenues, according to a Thomson Reuters consensus estimate.

The company cited new product launches, increased store efficiency, and new store openings as some of the major factors driving third-quarter results. The company added its recent improvements to its self-driving hardware position it for additional market share gains.



The earnings come weeks after Tesla announced record delivery and production numbers, beating out second-quarter delivery and production numbers by 70 percent and 37 percent, respectively.



For the second half of 2016, Tesla continues to back its forecast of 50,000 new vehicle deliveries, with a fourth-quarter plan of just over 25,000 deliveries.



Orders also remained strong, with combined net orders in the third quarter for the Model S and Model X rising 68 percent from the same period a year ago. Meanwhile, the company hit record production levels of 25,185 vehicles, or a gain of 37 percent from the second quarter, and an increase of 92 percent from the third quarter.

The Model X grabbed 6 percent of the U.S. large luxury SUV market during the quarter, according to the company. Tesla said that the large luxury SUV category represents a tremendous growth opportunity for the Model X, since it is three times the size of the large luxury sedan market, where the Model S fits.



Still, the Model S, which was launched more than four years ago, and it continues to grab market share. In the U.S., which is Tesla's most mature market, Model S deliveries grew nearly 60 percent year over year, the company said. That rate helped push it to a 32 percent share of the top 12 selling large luxury sedans, and "significantly outpaced" the U.S. large luxury sedan category's sales growth, it said.

Tesla also said it was on track to meet is goal of improving automotive gross margins by 2 to 3 percentage points on a GAAP and non-GAAP basis by the end of the year. (Non-GAAP automotive gross margins exclude ZEV credits and SBC.)

Capital expenditures this year are expected to be about $1.8 billion as it continues to focus on capital efficiency. For the past three quarters, capital expenditures totaled $759 million, the company said.

As of Sept. 30, Tesla said it had about $3.1 billion in cash and cash equivalents, compared with $3.2 billion at the end of the second quarter. The company invested $248 million toward increasing production capacity, Gigafactory construction, and growing the company's customer support infrastructure.

Tesla was also able to pay off $600 million in debt, and said it also improved liquidity by securing up to $300 million for its vehicle leasing program.