Electricity and gas prices have hit record highs around the world as economies began to recover from the coronavirus crisis, but companies such as Iberdrola say they have not benefited from this because they lock in prices with customers in advance.

Spain on Tuesday said it would introduce exemptions to a decree that was originally expected to claw back about 2.6 billion euros ($3 billion) in profit from companies deemed to have profited from the price rises.

Iberdrola's shares were buffeted by the measures, losing almost 14% of their value in less than three weeks, but recovered as it became clear the government would change tack.

The clawback cost the company 85 million euros.

"This impact will be withdrawn and is not expected to continue in the coming months after the measure adopted by the Spanish government yesterday," Chief Executive Ignacio Galan said on a conference call.

The stock rose on Wednesday despite the company reporting a 10% fall in net profit for the first nine months of the year, partly owing to the increased costs of buying power on wholesale markets to meet strong demand.

Iberdrola generates power through wind and solar farms and combined cycle gas plants in Europe, Britain and Latin America, owns and operates distribution grids and expects to supply power to 60 million customers worldwide by 2025.

When there is demand for more power than it can generate, Iberdrola buys extra on the open market. Fellow Spanish group Endesa blamed higher wholesale prices for a drop in its own profit earlier this year.

Nevertheless, Iberdrola's result beat market expectations for a turbulent nine months in which it was also hit by a chunky one-off tax charge in Britain, where it operates Scottish Power.

Adjusted for one-off factors, net profit rose 5.2% year on year to 2.7 billion euros.

Government targets to reduce planet-warming carbon emissions and strong investor appetite for environmentally sustainable businesses have buoyed Iberdrola's plans to spend 150 billion euros on tripling its global renewables capacity by 2030 in spite of the market volatility.

It stuck to its financial guidance for the full year and said it was speeding up expansion of its offshore wind business, a fast-growing sector that is key to the decarbonisation plans of some of the world's biggest economies.

The company now has huge turbines with a combined capacity of 1.5 gigawatts spinning offshore and is building a further 2.6 GW in France, the United States and Germany.

($1 = 0.8593 euros)

(Reporting by Isla BinnieEditing by Stephen Coates and David Goodman)

By Isla Binnie