Six people accused of a multi-million pound fraud conspiracy involving the sale of four opencast mining sites have had the case against them dismissed.
They were accused of planning to set up a company in the British Virgin Islands and transfer leases for the sites from Celtic Energy to avoid it having to restore them once coal extraction ends.
But a Cardiff Crown Court judge said nothing unlawful had taken place.
The Serious Fraud Office (SFO) said it was studying the judgement.
The six, which included former Cardiff City chief executive Alan Whiteley and former directors of Celtic Energy, Richard Walters and Leighton Humphreys, were charged with conspiracy to defraud Neath Port Talbot, Bridgend, and Powys councils along with the Coal Authority.
Once coal extraction ends, a company has an obligation to restore opencast sites - the estimated coast of restoring the East Pit site is £115m.
It was claimed under the plan, a new company would have been set up, called Oak Regeneration.
Oak Regeneration would have been under the control of Celtic Energy.
But it would mean that Caerphilly-based Celtic Energy was no longer obliged to pay to restore opencast sites.
No criminal action
After five days of legal submissions, Lord Justice Hickinbottom threw the prosecution case out saying that the six defendants had not acted unlawfully regardless of whether or not they had acted dishonestly.
"Lawful conduct cannot be rendered unlawful by the means," he said.
He added that conspiracy to defraud could not be proved in common law because the object of the conspiracy - the local authorities and the coal authority - had not suffered financial loss as a result of Celtic Energy/Oak Regeneration deal.
The court heard that the six may have been aware that the scheme was unlawful and might lead to prosecution and that they took legal advice to that effect.
But the judge said he could not judge "commercial morality".
After the hearing, an SFO spokesperson said: "We are studying the judgment carefully. As part of that process we are urgently considering whether to ask the High Court to permit the case to proceed."
Celtic Energy produces one million tonnes of coal per year from its sites in south Wales.