Britain’s Serious Fraud Office has been ordered to pay a £6 million legal bill in connection with a failed attempt to prosecute six individuals for an allegedly fraudulent mining scheme related to Celtic Energy, according to media reports.

Mr. Justice Hickinbottom threw out the case, calling the SFO’s prosecution attempt “improper and unreasonable,” according to an article in The Telegraph.

The SFO had accused two former directors of Welsh mining concern Celtic Energy, Richard Walters and Leighton Humphreys, and four others of attempting to defraud the Coal Authority, Neath Port Talbot, Bridgend, and Powys councils by transferring leases for four opencast mining sites in Wales to a firm in the British Virgin Islands. The SFO said this was an attempt by Celtic Energy to avoid requirements to restore its mining sites after the coal extraction was complete, the BBC reported.

All of the six defendants, including former head of Cardiff City Football Club, Alan Whiteley, were cleared of the charges and the SFO was ordered to pay their legal costs. The case had previously been tossed out by the High Court a year ago, but the SFO sought to continue under a voluntary bill of indictment, the BBC and the Telegraph reported.

“This was not simply an error of judgment: once the dismissal application had been formally notified and its essential basis set out, no reasonable prosecutor in the shoes of the SFO would have contested that application in the manner that the SFO in fact did,” Hickinbottom said, according to the Telegraph.

Hickinbottom also accused the SFO of trying “to save a fatally-holed ship” and called the case quite exceptional. “The SFO never approached this case with the requisite degree of legal analytical care or precision,” the BBC quoted Hickinbottom as saying.

The SFO told the BBC it is considering appealing the ruling on costs.

The latest high-profile loss for the SFO was reminiscent of its multimillion pound settlement last year with property tycoons Robert and Vincent Tchenguiz. The brothers had sought damages from the fraud office after high profile raids of their homes and offices and a badly handled investigation linked to an Icelandic bank collapse. The SFO agreed to pay Vincent Tchenguiz £3 million and his brother Robert £1.5 million as part of the settlement. SFO Director David Green also publicly apologized to the brothers for “mistakes” that were made during the investigation, which occurred before he took over the helm of the agency.

But last week was not all bad news for the SFO, which collected its first corporate conviction for foreign bribery following a contested trial in Southwark Crown Court. Father and son executives from printing concern Smith and Ouzman Ltd were sentenced for bribing public officials to win contracts in Kenya and Mauritania, according to the SFO. The pair reportedly codenamed their bribes “chicken” in correspondence about the scheme.

Smith and Ouzman Chairman Christopher John Smith, 72, was given a suspended sentence of 18 months with a three month curfew and ordered to conduct 250 hours of unpaid work. His son, Nicholas Charles Smith, the 43-year-old sales and marketing director, was sentenced to three years imprisonment for three counts, which will run concurrently, the SFO said. Both were barred from acting as company directors for six years. The company also was convicted of three offenses and will be sentenced later, the SFO said.

In his ruling, the Crown Court judge called the men’s actions “cynical” and “deplorable.”