Musk said he expects Tesla to begin delivering its much anticipated Cybertruck pickup by the middle of 2023, adding to Texas factory production. He forecast output at Texas and Berlin at 5,000 vehicles a week by the end of this year or early next year, and 10,000 a week by the end of 2023.

In its second-quarter shareholder letter, Tesla revised installed capacity numbers for its plants upward, with Fremont rising to 650,000, Shanghai rising to about 750,000, Berlin at 250,000 and Austin at 250,000. In Tesla’s first-quarter earnings letter, it had listed Fremont as 600,000, Shanghai as 450,000 and Berlin and Austin as “early ramp.”

In second-quarter financial results, the EV maker posted an adjusted profit of $2.27 per share vs. analysts’ consensus estimates of $1.81.

Its automotive gross margin fell to 27.9 percent, down from a year earlier and the preceding quarter, amid inflationary pressure.

Total revenue fell to $16.93 billion in the second quarter from $18.76 billion a quarter earlier, ending its streak of posting record revenue in recent quarters, as it struggled to meet demand for its electric cars due to a shutdown of its Shanghai factory and production challenges at new plants.

Analysts were expecting revenue of $17.10 billion, according to IBES data from Refinitiv.

“Tesla’s solid quarter is the latest sign that it has done an outstanding job navigating through global supply chain and logistics challenges, weathering the storm better than most legacy automakers,” Jesse Cohen, senior analyst at Investing.com, told Reuters.

Shares of Tesla were up about 9 percent in mid day trading Thursday. The shares are down about 35 percent since their peak in November.

Reuters contributed to this story.