By Becky Peterson

After months of slowing car sales and hits to its brand, Tesla has regained momentum.

The electric automaker and tech company sold 480,126 electric vehicles globally in the second quarter, up 24.9% from the same period last year, the company said Thursday.

Tesla also reported 40.6% growth in its energy business, a figure which measures how much battery energy the company deployed in the quarter. Energy deployments grew rapidly last year, even as its autos business slowed.

Tesla will report its full quarter earnings on July 22.

The second quarter sales continued the growth seen in the first quarter, when sales grew 6.3%. Despite that growth, the first quarter was Tesla's second-worst sales period since 2022.

The results mark the first time Tesla has reported vehicle deliveries since it stopped making two of its luxury models in May. Those vehicles, the Model X and Model S, previously sold new for around $100,000. The company still sold its remaining inventory of those vehicles in the second quarter.

Moving forward, the EV maker will sell just three new vehicles: the popular Model 3 and Model Y, and its low-volume stainless steel Cybertruck pickup.

Tesla's sales jump comes amid a wider downturn in the U.S. EV market. Most other automakers have reported sharp sales declines for their electric models in the second quarter. Overall electric sales in the U.S. were down 25% from the start of the year through May, according to data from Motor Intelligence.

Meanwhile, Tesla is pivoting its business away from vehicle sales to focus on robotaxis and humanoid robots, neither of which are currently for sale.

Chief Executive Elon Musk is on the hook to sell more vehicles as part of a $1 trillion pay package approved by Tesla shareholders in November, which requires him to hit a series of financial and operational milestones over the next decade.

Some analysts and investors expect Musk to shake things up before then, by merging Tesla with his rocket company, SpaceX. The space company has an $86 billion war chest after going public in June in the largest IPO of all time.

Earlier this year, Tesla and SpaceX announced plans for Terafab, a new AI chip research and manufacturing project in partnership with Intel. The companies have said the project is necessary to supply the new generation of robots at Tesla, as well as orbital data centers for SpaceX.

Still, vehicle sales accounted for around three-fourths of Tesla's revenue in 2025. Deliveries declined last year for the second year in a row amid backlash against CEO Musk's work with the federal government and growing competition from Chinese automakers in Europe and Asia.

Tesla started mass production of its long-awaited Semi-truck in April, and is expected to sell a few thousand in 2026 before ramping up production to 50,000 trucks annually.

The company is also working on a new version of its Roadster sports car, though it's unclear when that will be available for sale following almost a decade of delays.

In April, Musk told investors that Tesla had started mass production of its autonomous Cybercab, a two-door coupe with no steering wheel, pedals or side mirrors that is designed to run the company's Full Self-Driving software.

Musk previously said that Tesla will sell the Cybercab to customers for under $30,000 by the end of the year, though Wall Street analysts have questioned the timeline.

Musk cautioned on the last earnings call that the fully-autonomous software wasn't ready to scale because it still got confused by atypical traffic events.

"We have also had literal infinite loops where the car might want to make a turn into a road, but there's construction and then it goes around the block," Musk said.

Despite promises to expand its Robotaxi service nationally, Tesla has just dozens of autonomous vehicles operating as part of its Robotaxi ride-hailing service in Texas.

Write to Becky Peterson at becky.peterson@wsj.com