Electric vehicles are promoted as eco-friendly, but they’ve been plagued by claims saying they’re actually worse for the environment when you account for electricity generation and other factors.

Despite that, a new study published in Nature Sustainability suggests electric vehicles are indeed more eco-friendly – in most cases.

While the study is highly technical, it found that in 2015 “driving an average EV had a lower life-cycle emission intensity than driving an average new petrol car.” However, that’s dependent on how ‘green’ the energy grid is.

Also Read: The 2010s Proved EVs Could Work, The 2020s Will Show If People Actually Care

In particular, the study found that, on average, “even very inefficient EVs … would be less emission intensive than very efficient new petrol cars … if the grid’s emission intensity was below 700 gCO2e kWh−1.” The authors added electric vehicles generally have lower life-cycle emissions than most petrol cars and this finding is “robust against variations in uncertain production emissions, such as uncertain embodied emissions from producing batteries of EVs.”

While there is some market variation, the findings hold true for 53 of 59 world regions and this accounts for 95% of global road transport demand. They added that electric vehicles have an average of 31% less emissions per kilometer (0.62 mile) than petrol-powered cars when weighted for demand.

In 2015, EVs were “almost always” more efficient than petrol-powered models in North America as well as large sections of Africa and South America. However, EVs had higher emissions than petrol vehicles in a handful of countries such as India, Poland and the Czech Republic.

Speaking with the BBC, lead author Dr Florian Knobloch said “The idea that electric vehicles could increase emissions is a complete myth.” They added, “We have run the numbers for all around the world, looking at a whole range of cars and even in our worst-case scenario, there would be a reduction in emissions in almost all cases.”