German utilities RWE  (RWEOY) and E.ON  (EONGY) popped higher Tuesday after Germany's highest court ruled the companies could make a claim against the state for losses resulting from the country's decision to abandon nuclear energy.

E.ON shares climbed more than 5% while RWE added more than 4% in early trading, before both stocks slid back later in the day to trade up 4.23% and 1.7%, respectively by 15:30 GMT.

The court ruling relates to a u-turn by the conservative-led government of Chancellor Angela Merkel on an agreed phase out of Germany's fleet of nuclear power plants.

Merkel's government in 2010 extended the deadline for the plants' closures from a previously agreed date of 2021 to 2036, prompting new investment by the German utilities. That extension was then reversed and the state ordered the immediate closure of eight of Germany's oldest reactors in 2011, in the wake of the  Fukushima nuclear plant disaster in Japan.

E.ON and RWE, along with Sweden's state-owned Vattenfall, claimed that the government's about-face amounted to expropriation of their assets and that they were due compensation for the cost of investments and losses resulting from the change in the law.

Germany's Constitutional Court Tuesday disagreed that the state had effectively seized the utilities' assets but decided it had breached the companies' property rights and was liable to pay "appropriate compensation."

E.ON has said it will seek €8 billion in compensation, while Vattenfall has claimed €4.7 billion in losses. RWE has so far declined to put a figure on its losses, though analysts expect it to claim about €6 billion.

The final compensation deal will have to be agreed with the government and is likely to come in under the companies' estimates.

The amounts may also end up being offset against costs due to be levied against the utilities for the storage of radioactive waste from the power stations. In April, a parliamentary commission recommended the establishment of a $23.3 billion fund to finance that storage.

Germany's government has so far resisted demands that it share that financial burden, claiming that the utilities made the waste and remain solely responsible for it.