As delegates convene at UN-backed climate talks in Poland this week, the Spanish will have a new trophy in hand: a renewable energy plan that seeks to reverse years of rising emissions.

Spain’s proposals, set to be adopted by the cabinet in coming weeks, spell out an ambitious target to draw 100 per cent of the country’s electricity from renewables by 2050. The plan also aims to cut emissions by more than 90 per cent over the same period.

“We are a government convinced of the importance of working on positive, co-operative multilateralism, and also taking our share of responsibly on domestic action,” says Teresa Ribera, minister for the ecological transition.

Climate change already poses a direct physical threat to Spain. She states that the new government, which came into power in June, aims to decarbonise the economy.

Fresh water is not secure in 20 years’ time unless we organise things differently

“When we think of the wildfires in California and the wildfires in Portugal, we realise this is exactly what was predicted by climate scientists — and exactly what was predicted by climate scientists for Spain,” Ms Ribera says. “This is terrifying for us.”

Some of Spain’s agricultural lands also risk turning into desert as the continent heats up and water becomes more scarce, she adds. “Fresh water is not secure in 20 years’ time unless we organise things differently.”

The new plan, called the Climate Change and Energy Transition Law, sets out sweeping targets for how to wean the Spanish economy off fossil fuels, while also providing financial support and training to people whose jobs could be threatened by the change.

However the law must still be approved by parliament, where it could face opposition from those who want a more gradual transition away from fossil fuels.

Under the government proposal, no more new licences for oil and gas exploration in Spanish waters will be issued and the country will stop all drilling completely by 2040. Cars fuelled by petrol or diesel will be phased out, and after 2040 only electric and other “zero emission” vehicles will be sold in Spain.

To shift the electricity system away from fossil fuels, the government plans to start competitive tenders for 3,000MW of renewable power a year. Developing more energy storage will also be essential.

“Storage will be key in the energy transition,” says Ms Ribera. Using water reservoirs and hydropower facilities to store energy, for example, by pumping water uphill on a sunny day when solar power is abundant, is one area of more potential. “We want to test to what extent some share of the hydropower plays the function of storage,” she says.

The new policy heralds such a big change because renewables have had a troubled history in the country, observers note. For years, Spain was considered a classic example of how renewable energy policies could go wrong. The country launched generous subsidies for wind and solar starting in 2004 but abruptly halted these payments after the financial crisis.

The steep subsidy cuts applied to projects that had already been built, which meant financial ruin for many of Spain’s biggest solar investors. A series of legal cases suing the government for withdrawing subsidies are still working their way through the courts.

One of the core goals of the new plan is to give new confidence to investors, says Ms Ribera. “We need to be consistent, we need to facilitate the good decisions for investment that are needed in the years to come,” she says.

The plan has provoked some opposition. Anfac, an association which represents the Spanish automotive industry, has called for the rejection of the planned legislation which it says is “excessive in its objectives”.

Some companies have welcomed the new deal, however. The head of Iberdrola, the Spanish utility, points out that more than €100bn of investment will be required to meet the new energy goals, much of which will go to wind, solar and hydropower.

“Fighting climate change is a global task that has to be tackled urgently,” says José Ignacio Galán, chairman and chief executive of Iberdrola. “The EU has been leading this effort for decades. Now Spain is playing its part.”

A big difference from the last clean energy push is that subsidies are no longer needed for new solar to compete on cost with traditional power sources, says Meike Becker, an analyst at Bernstein.

“This new solar boom is going to be completely different,” says Ms Becker. “This is really the return to growth in renewables,” she says, forecasting that 30GW-40GW of new solar power will be installed in Spain between now and 2030.

Solar companies were quick to respond to the new government plan. Lightsource BP, a solar developer based in London, announced in November that it was opening an office in Madrid.

“I think Spain is a really interesting market,” says Nick Boyle, chief executive, pointing out that Spain’s potential solar resources are twice those of the UK.

The possibility of generating power in Spain that could be exported to the rest of Europe through interconnectors is particularly attractive, he says.

“If you think about the grid in Europe, and you think about generating electricity in Spain to supply to Germany or wherever, that is an amazingly exciting thing to be able to do.”