All electricity in Chile should come from renewable energy by 2040, a leading candidate in the country’s presidential elections has said.

Sebastian Piñera, of the centre-right National Renewal party, was president between 2010 and 2014 and is currently ahead in the polls.

Chile currently has to import large amounts of fossil fuels because it has virtually no deposits of its own.

However the country is prime territory for wind and solar power plants because of its long coastline and desert climate.

Speaking at a campaign rally, Mr Piñera outlined ambitious plans to decarbonise power generation and public transport.

“The goal is that by 2040, Chile has a 100 per cent clean and renewable electricity grid and a 100 per cent electric public transit system,” he said, according to Reuters.

A poll this month put Mr Piñera on 34 per cent of the vote, compared to 16 per cent for centre-left candidate Alejandro Guillier and 15 per cent for Beatriz Sanchez, of the hard-left Frente Amplio group.

Ms Sanchez and Mr Guillier have both spoken in favour of increasing renewable energy without actually giving a target date for the creation of a zero-carbon electricity grid, Reuters reported.

Earlier this year Mr Guillier said he wanted public transport to run on electricity and that he would support renewable energy generation.

The metropolitan railway in Santiago, the capital, was the first in the world to run almost entirely on solar power.