(Bloomberg) -- Spain and other Mediterranean countries generated record amounts of power from wind and solar farms last month, underscoring the potential for renewables to replace expensive fossil fuels.

For the first time ever, those clean sources accounted for 40% of Spain’s electricity in April, while the share surpassed a quarter in Italy, according to data collected by think tank Ember. Greece and Portugal also set records for solar generation, at a time when the European Union is moving to wean itself off Russian energy in the wake of its invasion of Ukraine.

“Wind and solar are breaking records around the world,” said Charles Moore, head of Ember’s European program. “This decade they need to be deployed at lightning speed.”

The EU is set to this month announce its plan for slashing imports of Russian gas by two-thirds this year, including through making it easier for wind and solar farms to receive permits.

Renewables are now among the cheapest forms of electricity — especially after an energy crunch and the Ukraine war bolstered gas, oil and coal prices — but still face challenges over how to store power when there’s a lack of sun or wind.

©2022 Bloomberg L.P.