Tesla made 53,239 Model 3 vehicles during the third quarter, the company announced Tuesday, meeting its goal for the production of its mass-market sedan, a key element of the company’s plans to turn an annual profit for the first time.

Earlier this year, Tesla projected it would produce between 50,000 and 55,000 Model 3 vehicles in the third quarter.

In total, Tesla said it delivered 83,500 vehicles, including its Model S and Model X, in the past three months.

In an email to employees over the weekend, chief executive Elon Musk said, “We are very close to achieving profitability and proving the naysayers wrong.” The company’s next earnings report will serve as a crucial test for Musk’s leadership. He has pledged that Tesla will turn its annual profit in the second half of the year.

The company’s latest vehicle report comes amid a turbulent time for the all-electric automaker. Tesla has been plagued by delays in production and delivery of the Model 3, its most affordable vehicle. Musk has described the recent period at the Fremont, Calif., plant where the cars are made as “production hell.” But the company reached a long delayed goal in June of producing 5,000 Model 3s per week.

Tesla said Tuesday that it had produced 5,300 Model 3s in the final week of the third quarter, sustaining its pace. Just last month, however, Musk said that “we’ve gone from production hell to delivery logistics hell,” in response to a customer who had complained that Tesla had repeatedly delayed her car delivery date.

Tesla said in its latest report that delivery and logistics were its main challenges in the third quarter. The company said it made several improvements to its delivery process and planned to expand a delivery program that brings vehicles straight to a customer’s home or office. According to Tesla’s website, new customers who purchase the most basic version of the Model 3 will receive it within four weeks. Tesla said it can deliver versions of the sedan with additional features within two to four months.

Tesla said it was able to boost deliveries of the Model S and Model X despite the escalating commercial battle between the United States and China. The nations have hit each other with punitive duties on roughly half of their traded goods. Tesla said the trade tensions have resulted in an import tariff rate of 40 percent for its vehicles, compared with 15 percent for other cars imported in China.

Just days ago, Musk settled a lawsuit with the Securities and Exchange Commission after the agency accused him of misleading investors. In tweets in August, Musk announced that he had plans to take the company private and had secured the funding to do so. Federal regulators say his statements were deceptive. They sought to strip Musk of his leadership role at Tesla and to bar him from serving as the chief executive of any public company. The settlement, however, allows him to continue running the company, although he must resign as chairman of Tesla within 45 days and cannot serve in that position for three years.