(Bloomberg) -- Tesla Inc. and BYD Co. set sales records in the second quarter, likely widening their lead as the world’s top electric-car makers.

Elon Musk-led Tesla delivered 466,140 cars worldwide, beating Wall Street estimates. BYD, China’s leading auto brand, posted its best-ever quarter, selling 700,244 fully electric and plug-in hybrid vehicles.

Tesla’s stock rose as much as 6.8% shortly after the start of regular US trading, while BYD closed up 4.5% in Hong Kong. Rivian Automotive Inc. shares also climbed after the EV maker exceeded expectations for quarterly production.

Tesla has vowed to push for more volume even at the expense of profitability, putting more pressure on legacy carmakers that have struggled to keep pace with their EVs. Volkswagen AG last week announced new leadership for its Audi brand, which fell behind Tesla in overall first quarter sales.

Analysts surveyed by Bloomberg had expected Tesla to deliver 448,350 cars in the last three months.

“It’s a big beat,” Ben Kallo, a Robert W. Baird analyst, said by phone Sunday. “People were still bracing for another round of price cuts, and this big delivery number makes that less of a risk.”

Read More: Tesla Sales Surge, But at What Cost?

Tesla’s deliveries soared 83% from a year ago, when lockdowns hampered its operations in China. The company produced 13,560 more vehicles than it delivered in the last three months, after output exceeded sales by almost 18,000 cars in the first quarter.

“Everyone was worried about inventory build, and it looks like they’ve normalized,” Kallo said. “The delta between production and deliveries is shrinking, which is what Tesla said they would do.”

Tesla’s Perks

In addition to slashing prices across its lineup, Tesla has offered perks such as three months of free fast-charging in the US and insurance-related subsidies in China to stoke sales. Some analysts have predicted price cuts will continue into next year.

“Tesla has delivered upon its unit volume expectations when the shares were last trading at this level, but at the sacrifice of substantial revenue and margin,” JPMorgan analyst Ryan Brinkman wrote in a report Monday. He advised caution on the shares, which have more than doubled already this year.

Tesla remains by far the top EV maker in the US, but it’s facing stiff competition around the world from companies with fresher lineups. It newest vehicle — the Model Y — debuted in 2020.

The company has fallen well behind BYD in China, its No. 2 market after the US. Right after the quarter came to a close, Tesla cut prices of its premium models in China by more than 4.5%.

The Austin-based company will report second-quarter earnings on July 19.

BYD’s Records

BYD gained ground on Tesla in fully electric vehicle sales, almost doubling deliveries to 352,163 units in the second quarter.

The Shenzhen-based company’s total sales soared 98% from a year ago. The company sold a record 251,685 new-energy vehicles in June.

Smaller Chinese upstart Li Auto Inc. posted a new monthly high of 32,575 deliveries, while Xpeng Inc. and Nio Inc. saw modest increases. Guangzhou Automotive Group Co.’s EV brand Aion stood out with another strong month of sales, with 45,013 deliveries.

June sales “are showing new energy vehicle demand remains pretty strong” despite China’s economic drag, said Joanna Chen, a Bloomberg Intelligence autos and EV batteries analyst.

--With assistance from Charlotte Yang.

(Updates with Tesla share move in the third paragraph.)

©2023 Bloomberg L.P.