US car buyers are showing a surge in interest in electric vehicles after Donald Trump’s decision to attack Iran helped cause a major jump in gasoline prices.

The cost to refuel a vehicle in the US is at its highest level in nearly three years, with the average national price of gas standing at $3.90 a gallon on Friday.

This increase has been driven by the rising global cost of oil in the wake of the US and Israel’s bombing of Iran, a major oil producer. The conflict has resulted in the strait of Hormuz, a vital waterway that conveys around a fifth of the world’s oil, being shut off by Iran.

Drivers in the US have responded to this situation with a surge of fresh interest in EVs, which do not require gas and do not emit the pollution that is dangerously overheating the planet. Searches for electric car models are up by 20% since the attack on Iran started three weeks ago, according to CarEdge, a car-buying platform.