A new independent study from Germany has found that, over the course of a 124,274-mile (200,000 km) lifespan, electric vehicles are considerably greener than their gas or diesel counterparts, despite starting out life with a larger ecological debt that leaves a lot of room for improvement.

The production of batteries is a dirty business, and means that the production of EVs causes more pollution than the production of internal combustion vehicles. However, the study found that it currently takes 55,923 miles (90,000 km) for an EV to amortize that debt, and to become greener than an ICE vehicle.

“The exact life cycle assessment of cars depends on numerous factors – the production site, the energy mix in the production of vehicles and components as well as the drive system used on the road and the energy used,” said Dr. Joachim Damasky, the chairman of VDI Gesellschaft Fahrzeug, a German engineering association. “EVs and hybrid vehicles start with an ecological burden through the resource-intensive production of drive technology in their life cycle assessment, since battery production is now almost exclusively still taking place in Asia.”

Read: E-Bikes Are Slashing Global Oil Demand Four Times As Much As EVs

 EVs Pollute 30% Less Than ICE Over Lifetime, But Only After 56K Miles

However, over the course of their lifetime, EVs become the cleaner option. After 124,274 miles (200,000 km) an EV will have caused 24.2 tons of CO2 emissions. By comparison, a diesel vehicle will have emitted 33 tons, which is over 36 percent more.

VDI’s analysis was also positive about the environmental friendliness of hybrids. According to the organization, over the same period of time, a plug-in hybrid vehicle is expected to emit 24.8 tons of CO2, just 0.6 tons more than an EV.

While that makes electrified vehicles the better option, environmentally, it leaves a lot of room for improvement. For instance, if an EV is powered using electricity from fossil fuels, it could take as long as 99,419 miles (160,000 km) to become greener than an internal combustion vehicle.

“We need to look at the greenhouse gas emissions of production, duration and disposal in the life cycle assessment,” said Damasky. “We therefore need more battery production made in Germany, better battery recycling and the rapid expansion of renewable energies.”

The VDI has seven recommendations for the transportation industry. Firstly, it highlights the importance of a green power grid. Second, EV battery production must be less taxing on the environment, and producing them locally will help with that, as will recycling them. It is also bullish about the use of e-fuels, and encourages the adoption of PHEVs. Finally, it recommends improving more train transportation for urban areas.

 EVs Pollute 30% Less Than ICE Over Lifetime, But Only After 56K Miles