Energy prices may have jumped to unprecedented highs, but for France's state-controlled power company EDF 2022 was a miserable year with record annual losses of €17.9bn (£16bn).
A price cap on energy for French consumers hit EDF profits hard but so did the enforced closure of many of its of nuclear power stations for repairs.
The losses are the third biggest in French corporate history and the worst for more than 20 years.
EDF's debts have spiralled to €64.5bn.
The losses are in marked contrast to EDF's UK-based business, which made an underlying profit of £1.12bn supplying electricity and gas to five million households.
In France, President Emmanuel Macron's government responded to Russia's invasion of Ukraine by imposing a tariff "shield" for consumers, limiting energy companies to a 4% rise in 2022 followed by 15% in 2023, keeping inflation lower than in other European countries.
But it meant that EDF had to sell power to French consumers at a loss, while UK consumers paid far more for their energy. EDF has around 80% of France's electricity market.
French industry has not seen such poor results since 2002, when Vivendi Universal and France Telecom both posted losses above €20bn for the previous year.
EDF has never before reported such large losses.
"The 2022 results were significantly affected by the decline in our electricity output, and also by exceptional regulatory measures introduced in France in difficult market conditions," said Chief Executive Luc Remont, who said EDF's priority was now to put the company back on track. He said core earnings would be significantly higher in 2023.
EDF's nuclear output in France fell by 30% to its lowest since 1988 as more than half of its 56 ageing nuclear power stations went offline for repairs, which had been delayed because of the Covid-19 pandemic. France has the biggest fleet of nuclear plants in Europe.
The outages meant that France became a net importer of electricity for the first time in decades.
EDF's financial woes have various causes, but another major factor is an obligation it has to sell a quarter of its production at a fixed price to its competitors.
The system known as Arenh (Regulated Access to Historic Nuclear Electricity) was devised in 2010 in order to satisfy the EU, which was worried about EDF - with its massive nuclear capacity - becoming a monopoly provider.
It meant the French electricity market was able to open up to competition, but EDF says it has forced the company into the absurd situation of subsidising its competitors.
In 2022 things became "surreal" in the words of one former CEO. Because of the soaring cost of electricity on the European market, EDF's own generating capacity hit by technical problems, and with the government extending the low price guarantee to customers - EDF was having to buy in electricity at €100 a unit, and sell it to rivals at €46.
And many of these competitors, EDF argues, aren't real players at all but simply market traders.
Three former CEOs have described the system as "a poison pill" and have blamed the EU and Germany for rigging the system against France's interests.
Although the French state already controls 84% of EDF, the government has begun a process to fully nationalise the company. Major changes are likely, not least to Arenh.
President Macron has spoken of a renaissance in the nuclear industry, with plans for six new reactors to help France reach carbon neutrality by 2050, in line with EU aims.