Tesla sold slightly more cars in the first three months of 2026 than a year earlier, the company said Thursday, a sign that rising gasoline prices as a result of the war with Iran may be prompting more consumers to choose electric vehicles.

Tesla said it delivered 358,023 vehicles globally from January through March, compared to 336,681 during the same period a year earlier. The increase, while small and slightly below analysts’ expectations, was notable because people who bought those cars in the United States did not benefit from the federal tax credits that were in place during the same period last year and cut up to $7,500 from the purchase price.

After Congress eliminated the tax credit at the end of September, sales of electric vehicles in the United States plunged by more than a third. The bump in deliveries at Tesla does not reverse that trend, but is the latest indication that higher fuel costs are helping to revive sales of electric vehicles.

Auto executives caution that it usually takes several months of sustained high fuel prices for consumers to shift to more efficient cars. But there are tentative indications that more people are at least considering electric vehicles or hybrids, which have both gasoline motors and batteries. And some electric models are selling well.

Hyundai said Wednesday that sales of its electric Ioniq 5 in the United States rose 13% in March. Kia, which is controlled by Hyundai, said Wednesday that sales of its electric models rose 30% during the first quarter.

General Motors’ Cadillac division recorded a 20% increase in sales of electric models during the first three months of the year, a sharp contrast to the company’s overall sales, which fell 10%.

Electric vehicles usually cost thousands of dollars more to buy than comparable cars that run on fossil fuels, but owners may make up the difference in fuel savings. Electricity is usually cheaper per mile than gasoline, especially for people who can charge vehicles at home.

Affordability is generally on the minds of consumers, and as electric vehicles become less expensive, the price of gas might weigh more heavily on the decision of what kind of car to buy. Compared to 2022 — the last time the average price of gasoline topped $4 a gallon in the United States — there are more electric models available, and prices have come down.

Higher gas prices also seem to be giving people a reason to buy hybrid vehicles. Toyota and Honda are likely to benefit in the long term because of their wide selection of hybrids, which can travel short distances on battery power and offer better fuel economy than vehicles that run solely on gasoline.

If that trend continues, Ford Motor, General Motors and Stellantis, the maker of Chrysler and Jeep vehicles, could suffer because they make most of their money from large pickups and SUVs that burn more fuel.

The average price of a new car has risen above $50,000, which is out of the reach of many buyers. Higher gas prices make new cars even more difficult to afford, and may push some buyers to look for ways to save money.

Usually it would “take four to six months to change people’s behavior or drive those sales of smaller vehicles,” said Lenny LaRocca, who leads the U.S. automotive practice at KPMG, a consulting firm. “Today is a little different because I do believe there’s a real affordability problem.”

Car shopping sites like Edmunds and CarGurus say more shoppers have been researching electric vehicles since the beginning of war with Iran on Feb. 28. The number of people checking out new electric vehicles on CarGurus rose 31% during March, while searches for hybrids rose 15%.

“Shoppers are gravitating toward more practical, affordable options as costs rise across the board,” Kevin Roberts, director of economic and market intelligence at CarGurus, said in an email.

Sales of used electric vehicles, which cost about the same as comparable gasoline vehicles, surged 29% in January and February, even before gas prices began to rise, according to Cox Automotive.

That is a sign that many consumers are ready to choose electric vehicles if they can afford them. In Europe, hybrids and cars that run solely on batteries already account for 67% of the new car market.

Many auto executives believe that electric vehicles will eventually displace gasoline vehicles as the technology improves and prices fall. One of them is Jon McNeill, a member of GM’s board of directors and author of “The Algorithm: The Hypergrowth Formula That Transformed Tesla, Lululemon, General Motors and SpaceX.”

“It’s just kind of hard to defy gravity if there’s a better product that has better drive characteristics, much lower maintenance and lower total cost of ownership,” McNeill said in an interview.