DETROIT — Tesla’s second-quarter deliveries rose 83% from a year ago after the company cut prices several times on its four electric vehicle models and buyers took advantage of U.S. government tax credits.

The Austin, Texas, producer of EV, solar panels and batteries said Sunday that it sold a record 466,140 vehicles worldwide from April through June, nearly doubling the 254,695 it sold during the same period a year earlier. The vast majority of the sales were Tesla’s popular Model 3 and Model Y versions.

But the price cuts, both for special orders and on existing inventory, raised questions from analysts who expect the cuts to reduce Tesla’s profit margins when it announces second-quarter earnings on July 19.

Tesla chargers quickly becoming EV industry standard – here’s how

Tesla’s sales were better than Wall Street expectations. Analysts polled by data provider FactSet expected deliveries of 445,000 for the quarter.

The company produced 479,700 vehicles from April through June, about 13,000 more than it sold, indicating that inventories may be building.

The second-quarter sales bring Tesla to nearly 900,000 vehicles for the first half of this year. The company sold 422,875 vehicles from January through March.

CEO Elon Musk has predicted that sales will grow about 50% per year for the near future. To reach that number for the full year, the company would have to sell 1.97 million vehicles. Analysts expect Tesla to fall a little short, delivering 1.82 million vehicles for the year.

Tesla cut U.S. prices at least four times during the quarter for vehicles ordered by customers. Larger price drops emerged on store inventory toward the end of the quarter in mid-June. The company trimmed prices on some Model 3 cars by more than $3,000. Model X SUV price cuts reached over $10,000, and the company threw in three years of free charging for the S and X. The Model S sedan saw cuts of about $7,500.

Tesla is powering NC’s shift to EVs, state data shows

Prices even were reduced on inventory of the Model Y small-SUV, Tesla’s top seller, by as much as $1,570 in a late June push to move vehicles.

But sales were almost certainly boosted by a $7,500 U.S. government tax credit from the Inflation Reduction Act that was available on nearly all Tesla models during the second quarter.

Wedbush Analyst Dan Ives said price cuts in boosted sales, especially in China, but there will be a price to pay in reduced profit margins. He expects Tesla’s margins to hit bottom during the next two quarters, recovering to normal levels next year.

“We’re going to likely see the price cuts have weighed on margins,” Morningstar analyst Seth Goldstein said.

Tesla’s automotive gross profit margin (excluding regulatory credit revenue), the company’s gross profit compared to revenue, was as high as 30% early last year. But as interest rates rose, Tesla began cutting prices last year, and the margin fell to 19% in the first quarter. Analysts expect 16.9% from April through June, according to FactSet.

Ives said Tesla’s U.S. inventory is starting to grow. “That’s going to be a bit of an overhang going into the second half of the year,” he said.

Deliveries, he said, aren’t the whole Tesla story. With General Motors, Ford, Rivian and Volvo announcing that they’ll join Tesla’s charging network and start using its plug, Tesla will get millions in charging revenue.

EV chargers & you: What Tesla’s deals with GM, Ford (and others?) mean to drivers

“I do believe investors are starting to appreciate the sum of the parts story,” Ives said.

Shares of Tesla have more than doubled in value this year, largely on news that General Motors and Ford are joining the company’s charging network. Tesla shares closed Friday at $261.77.

Goldstein expects that Tesla to ramp up production at new factories in Austin, Texas, and in Germany, further reducing the company’s fixed costs. “I think we’re likely looking at the bottom in the first half of this year, and then margins will slightly recover from there,” he said.