A cheesemaker has demanded a council pay him almost £400,000 in compensation after it lost a battle to condemn his products.
Humphrey Errington has been told he can sell his cheese again after a legal win over South Lanarkshire Council which wanted them declared unsafe to eat.
The council had called for his goods to be destroyed following an E.coli outbreak that killed a young girl.
But a sheriff ruled Errington Cheese did not breach safety standards.
Hamilton Sheriff Court has now officially lifted an order stopping the company's Lanark Blue and Corra Linn being sold.
The ruling comes two years after Food Standards Scotland issued a ban on all cheese made by the producer.
But Errington Cheese has repeatedly insisted its products and cheesemaking processes are safe.
A civil hearing heard one batch of Lanark Blue and three Corra Linn will be destroyed but the remaining items can be put on the market.
The council confirmed it would not appeal the decision of a case which has already cost Errington £350,000 and the taxpayer £500,000.
The firm now has to wait for a ruling on its expenses, which it estimates to be in the region of £380,000.
Speaking after the hearing, Mr Errington said he hoped to be able to complete a customer order for the remaining Corra Linn but that the Lanark Blue had to be destroyed.
He said: "We have asked for compensation for the costs of defending the case.
"We have legal costs, costs for storing cheese and loss of cheese.
"People may ask why taxpayers in South Lanarkshire should be forced to pay this bill if we are successful but the real culprit is Food Standards Scotland who forced the issue."
Mr Errington said the case had caused terrible strain.
He said: "The sheriff does seem to have some degree of sympathy towards us on the issue of expenses given the public interest in the case both from a council point of view and our own.
"It is a relief that they are not going to appeal the judgement and all that that would have entailed.
"We had letters from the council that did seem to suggest an appeal was coming and that was a great worry for us."
A report from Health Protection Scotland last year concluded that an E.coli O157 in 2016 in which a three-year-old girl died was linked to Dunsyre Blue Cheese, which is produced by Errington.
A range of Errington products are made from unpasteurised milk on its farm in Carnwath, South Lanarkshire, and environmental workers seized batches of their Lanark Blue and Corra Linn as a result of the outbreak.
But the Crown Office said there would be no criminal proceedings because of a lack of evidence linking Errington to the death of the girl from Dunbartonshire.
Earlier this year officials also ruled out holding a fatal accident inquiry into her death.
A spokesman for Food Standards Scotland (FSS) said: "We are aware of the hearing today in regard to the sheriff court action between South Lanarkshire Council and Errington Cheese Ltd relating to specific batches of Corra Linn and Lanark Blue cheese.
"It should be noted that these court proceedings concluded that some batches of Corra Linn and Lanark Blue cheese should be condemned and that others should not.
"The proceedings did not relate to the Dunsyre Blue cheese which tested positive for pathogens (bacteria which could cause illness) during the E.coli O157 outbreak of 2016, or other batches of cheese produced around the time of that incident.
"Food Standards Scotland's actions and decisions throughout this incident were based on the best available evidence and were taken in the interests of public safety.
"Our priority will always be the protection of public health."
A South Lanarkshire Council spokesman said: "The council will fully comply with the order from the sheriff who has indicated he will make a written decision on expenses within seven days."