Spain has set out plans to switch entirely to renewable electricity by 2050, with goals that go further than current European Union plans.

Under the new strategy, greenhouse gas emissions from Spain would be cut by 90 per cent compared to 1990 levels by the middle of the century.

The nation intends to invest massively in wind and solar power over the next decade, while banning new licences for fossil fuel drilling and fracking wells.

It is also planning to source 70 per cent of electricity from renewables by 2030, and 100 per cent by 2050. In 2017 Spain got roughly a third of its power from renewable sources such as sunlight, wind, rain, tides, waves, and geothermal heat.

Experts have welcomed the move as evidence Spain is “deadly serious” about fighting climate change, and an example to other nations in setting ambitious targets.

The country's socialist government set out this strategy ahead of other European nations in a draft law.

“It is exciting to see Spain setting the pace in its commitment to a 100 per cent renewable powered future,” said James Watson, CEO of SolarPower Europe. “Spain’s energy ambition is a wake-up call to all the other states across the world, as it demonstrates what we know – it is possible to power large economies by renewables in the very near future.”

10 photographs to show to anyone who doesn't believe in climate change Show all 10 1 /10 10 photographs to show to anyone who doesn't believe in climate change 10 photographs to show to anyone who doesn't believe in climate change A group of emperor penguins face a crack in the sea ice, near McMurdo Station, Antarctica Kira Morris 10 photographs to show to anyone who doesn't believe in climate change Floods destroyed eight bridges and ruined crops such as wheat, maize and peas in the Karimabad valley in northern Pakistan, a mountainous region with many glaciers. In many parts of the world, glaciers have been in retreat, creating dangerously large lakes that can cause devastating flooding when the banks break. Climate change can also increase rainfall in some areas, while bringing drought to others. Hira Ali 10 photographs to show to anyone who doesn't believe in climate change Smoke – filled with the carbon that is driving climate change – drifts across a field in Colombia. Sandra Rondon 10 photographs to show to anyone who doesn't believe in climate change Amid a flood in Islampur, Jamalpur, Bangladesh, a woman on a raft searches for somewhere dry to take shelter. Bangladesh is one of the most vulnerable places in the world to sea level rise, which is expected to make tens of millions of people homeless by 2050. Probal Rashid 10 photographs to show to anyone who doesn't believe in climate change Sindh province in Pakistan has experienced a grim mix of two consequences of climate change. “Because of climate change either we have floods or not enough water to irrigate our crop and feed our animals,” says the photographer. “Picture clearly indicates that the extreme drought makes wide cracks in clay. Crops are very difficult to grow.” Rizwan Dharejo 10 photographs to show to anyone who doesn't believe in climate change Hanna Petursdottir examines a cave inside the Svinafellsjokull glacier in Iceland, which she said had been growing rapidly. Since 2000, the size of glaciers on Iceland has reduced by 12 per cent. Tom Schifanella 10 photographs to show to anyone who doesn't believe in climate change A river once flowed along the depression in the dry earth of this part of Bangladesh, but it has disappeared amid rising temperatures. Abrar Hossain 10 photographs to show to anyone who doesn't believe in climate change A shepherd moves his herd as he looks for green pasture near the village of Sirohi in Rajasthan, northern India. The region has been badly affected by heatwaves and drought, making local people nervous about further predicted increases in temperature. Riddhima Singh Bhati 10 photographs to show to anyone who doesn't believe in climate change A factory in China is shrouded by a haze of air pollution. The World Health Organisation has warned such pollution, much of which is from the fossil fuels that cause climate change, is a “public health emergency”. Leung Ka Wa 10 photographs to show to anyone who doesn't believe in climate change Water levels in reservoirs, like this one in Gers, France, have been getting perilously low in areas across the world affected by drought, forcing authorities to introduce water restrictions. Mahtuf Ikhsan

The country intend to go beyond the current EU target of 32 per cent and install 35 per cent overall renewable energy by 2030, with at least 70 per cent renewable electricity.

It is also aiming to improve energy efficiency by 35 per cent, once again going beyond the EU target of 32.5 per cent.

In their announcement, the Spanish authorities have emphasised a “just transition”, shutting down coal mines but ensuring that there are sufficient retirement packages and retraining to ensure no one is left behind in the transition.

Support free-thinking journalism and attend Independent events

“The draft Spanish climate law is an excellent example of the implementation of the Paris agreement: it sets a long-term goal, provides incentives on scaling up zero emission technologies and cares about a good transition for the workforce,” said Christiana Figueres, former executive secretary of the United Nations Framework Convention on Climate Change. “As an early mover Spain will gain economically and create new jobs in the renewables sector.”

Laurence Tubiana, CEO of the European Climate Foundation, described the Spanish government’s action as “groundbreaking”.

She said: “By planning on going carbon neutral Spain shows that the battle against climate change is deadly serious, that they are ready to step up, and plan to reap the rewards of decarbonisation.”

She added that Spain was showing the European Commission the way before it presented its long-term climate strategy at the end of November.

The UK is currently aiming to reduce emissions by 80 per cent by 2050, but experts have warned that stricter targets will be required to avoid the worst effects of global warming.

The government has asked its advisers to look into the measures required to implement stricter targets, but it has also faced criticism for its failure to support renewable sources like onshore wind, and its continued support for fracking.