The legal cost of the Welsh Assembly Government's fight to challenges to its planned badger cull pilot was more than £57,000, it has emerged.
A BBC Wales Freedom of Information request showed it included £20,000 paid towards the Badger Trust's costs.
The trust last month won its court fight to halt a cull in north Pembrokeshire and parts of Ceredigion.
Court of Appeal judges said the plan should have referred to the proposed cull area only, not the whole of Wales.
The £57,446.65 external legal costs faced by the assembly government were revealed by the office of the chief veterinary officer for Wales.
Ministers had hoped to carry out a cull in north Pembrokeshire as they saw this as a way to prevent cases of TB in cattle.
The appeal court made its decision after the Badger Trust appealed against the cull, questioning its effectiveness.
Lord Justice Pill said the assembly government was wrong to make an order for the whole of Wales when it consulted on the basis of an Intensive Action Pilot Area (IAPA) which only supported a cull on evidence within the IAPA.
About 1,500 badgers would have been killed under the plan.
Farmers' unions later described the decision to stop the cull as a disaster for farming.
But the Badger Trust said that "killing badgers can play no meaningful part in the eradication of bovine TB and that robust cattle measures are sufficient".