On Sunday afternoon, Elon Musk congratulated employees at Tesla (NASDAQ:TSLA) for reaching a big milestone: producing more than 5,000 Model 3 sedans in a week. He also stated that Tesla is on track to produce 6,000 Model 3s per week by the end of August.

Tesla's vehicle production has ramped up dramatically over the past few quarters -- albeit not as quickly as originally planned -- leading Musk to comment that Tesla had become "a real car company." However, Tesla now faces an equally daunting task: becoming sustainably profitable.

Tesla hits a key milestone (barely)

For more than a year, reaching a Model 3 production rate of 5,000 per week has been Tesla's No. 1 goal. In early 2017, management projected that Tesla would be building 5,000 Model 3s per week by the fourth quarter of that year and 10,000 per week at some point in 2018.

As recently as early Aug. 2017, Tesla still expected to meet those production targets, but they were wildly unrealistic. Indeed, Tesla struggled just to produce 2,020 Model 3s in the span of a week at the end of March 2018.

Tesla made extraordinary efforts to reach the 5,000 per week production milestone by the end of June. It even set up a second Model 3 production line in a semi-permanent tent-like structure. This move paid off, enabling Tesla to build 5,031 Model 3 sedans in the final week of the second quarter (along with 1,913 Model S and Model X vehicles).

A silver Tesla Model 3 on a road, with a green field in the background

Tesla finally built 5,000 Model 3s in a week at the end of June. Image source: Tesla.

For the second quarter as a whole, Tesla produced 28,578 Model 3s. This implies that Tesla built an average of fewer than 2,000 Model 3s per week during the first 12 weeks of the quarter. In other words, Tesla is hardly in the midst of a smooth ramp-up in production. As a result, while Tesla clearly hopes to continue building Model 3s at a rate of 5,000 per week or more during the third quarter, it still isn't clear that it can average that level of output over an entire quarter.

Next stop: Profitability?

In addition to announcing that it had reached the 5,000 Model 3s per week production milestone in its Monday press release, Tesla also projected that it will produce positive GAAP net income and cash flow in the third and fourth quarters.

Turning profitable is arguably a far more important milestone than hitting an arbitrary production target. However, even if Tesla does meet its profit goals in the second half of 2018, it doesn't necessarily mean that the company will be able to remain profitable beyond this year.

As I discussed last month, Tesla faces two interlocking challenges. On the one hand, it needs to maximize average transaction prices (ATPs) for the Model 3, because vehicles with lots of options selected will be far more profitable than $35,000 base models. On the other hand, Tesla needs to start lining up additional orders as its Model 3 production accelerates. (The backlog of Model 3 orders has been relatively stagnant for the past two years.) Pushing toward a super-premium mix may not be consistent with achieving high sales and production volumes.

This is just another surge

Over the past year, Tesla has scrambled at various points to hit relatively arbitrary production targets. There's a big risk for investors that it will now scramble to produce positive earnings and cash flow in the third and fourth quarters, even at the expense of achieving long-term goals.

Last week, Tesla adjusted its Model 3 options packages, reducing the price of the dual-motor version by $1,000 and allowing buyers of the performance version to pick and choose options rather than having everything bundled together. Meanwhile, Tesla stated that it will allow all remaining Model 3 reservation holders to begin configuring their cars for delivery later this year -- as long as you take the long-range battery and premium interior options, at a minimum.

In effect, Tesla is skimming off the most profitable Model 3 reservations for production in 2018. By adjusting the options packages (and pricing), it is trying to get as many reservation holders to take super-premium versions of the Model 3 as possible. Furthermore, it is only building Model 3 versions priced at $49,000 and up. (The $35,000 base model -- originally supposed to be available by Nov. 2017 -- won't be delivered until 2019.)

If Tesla reaches its production targets over the next six months, it could run out of orders for the priciest versions of the Model 3 sometime around the end of the year. Thus, Tesla's ATPs for the Model 3 could fall from well north of $50,000 in the second half of 2018 to $40,000 or less in 2019.

Given that options packages tend to be extremely lucrative for automakers, an abrupt downshift in the Model 3 production mix is likely to have a severe negative impact on Tesla's profitability, more than offsetting any benefit from smoothing out the production process. Until Tesla can earn a profit building a normal mix of Model 3s, it will not have proven that it has a future as a mass-market automaker.

Adam Levine-Weinberg has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Tesla. The Motley Fool has a disclosure policy.