Tesla shares fell Wednesday after the company posted a wider-than-expected loss as it spent heavily to ramp up production of its Model 3, its first mass market electric sedan.

Complications with Tesla's manufacturing processes have slowed production of the Model 3, a car widely considered key to Tesla's future success. Hopes for the Model 3 have helped propel Tesla's stock so far this year.

But in a letter to shareholders, Tesla warned it expects to achieve a production rate of 5,000 Model 3 cars per week late in the first quarter of 2018. Previously, the company had said it hoped to achieve that number by the end of this year.

Tesla shares were down 5 percent in extended hours trading.

Here's how the company did compared with what Wall Street expected:

Loss per share of $2.92 vs. $2.29 expected according to Thomson Reuters

Revenue of $2.98 billion vs. $2.95 billion expected according to Thomson Reuters

During the third quarter, Tesla said it had record net orders and deliveries of its Model S and Model X. The company confirmed it delivered 25,915 Model S and Model X vehicles and 222 Model 3 vehicles during the quarter, for a total of 26,137 deliveries.

Tesla said its production rate of the Model 3 is steadily increasing, but the high degree of automation on the Model 3 production line has proven challenging, said Tesla in the shareholder letter.

"We continue to make progress resolving early bottlenecks related to these issues, and there remain no fundamental problems with our supply chain or any of our production processes," Tesla said in the letter.

In particular, the battery manufacturing process at Tesla's Gigafactory 1 held Model 3 production back, Tesla said. Tesla had to take over part of the manufacturing process from suppliers and redesign the process, the company said. Tesla expects throughput to increase substantially in the near future.

The delay in Model 3 production is not likely to dampen demand for the vehicle, said Jessica Caldwell, executive director of industry analysis for Edmunds.

"Model 3 reservation holders may not be thrilled about the fact that they have to wait longer than they thought for their vehicle, but it likely won't cause them to cancel their orders en masse," Caldwell said. "Many Model 3 customers put deposits down on the vehicle more than a year ago before they even saw the vehicle, so it's clear Tesla buyers don't follow the usual logic-driven car buying process."