Tesla Inc. said on Saturday its global deliveries fell to 254,695 in the second quarter, snapping a two-year streak of gains, as a COVID-related shutdown in Shanghai hit production and supply lines.

In the preceding quarter, the U.S. electric vehicle maker delivered 310,048 vehicles globally. Sales totaled 201,250 in the second quarter a year ago.

Analysts expected Tesla to report deliveries of 295,078 vehicles during the April-June period, according to Refinitiv data. Several analysts had slashed their estimates further to about 250,000 due to China’s prolonged lockdown.

Tesla said it delivered 238,533 Model 3 compact cars and Model Y crossovers, as well as 16,162 Model S and Model X vehicles to customers in the quarter.

Total production fell 15 percent to 258,580 vehicles from the first quarter. Still, June 2022 marked a monthly high for vehicle production in Tesla’s history, the company said Saturday.

Deliveries are one of the most closely watched metrics at Tesla. They underpin the Austin, Texas, company’s financial results and are widely seen as a broad barometer of consumer demand for EVs amid a wider shift away from the internal combustion engine.

Dan Levy, an analyst with Credit Suisse, reduced his delivery estimate for the period to 242,000 units. “In aggregate, we believe the Shanghai shutdown accounted for about 90,000 units of lost production in the second quarter,” Levy wrote in an earlier note to clients.

Tesla makes the Model S, X, 3 and Y vehicles at a plant in Fremont, Calif. It also produces the Model 3 and Y at the factory in Shanghai. The company has begun delivering the first Model Ys from a new plant near Berlin and held a “Cyber Rodeo” event for 15,000 people in April to celebrate a new factory in Austin.

However, both the Berlin and Austin sites have been slow to ramp up production, with Musk warning in a late May interview that both plants are “gigantic money furnaces.”

Analysts and investors are also worried that the price hikes automakers are imposing to combat soaring raw material costs will weigh on demand. Tesla had boosted its sticker prices by as much as $6,000 an EV in June, according to Electrek.

A stronger-than-expected delivery number could provide a boost to Tesla’s stock, which is down more than 35 percent this year amid wider market concerns about rising energy costs, inflation and a potential recession. Musk shares many of those concerns and is in the process of laying off 10 percent of Tesla’s salaried work force while pushing others to return to the office.

Earlier this week, Tesla laid off roughly 200 people on its Autopilot team, mostly hourly employees who worked as data annotation specialists.

Reuters and Bloomberg contributed to this report.