A second legal challenge over plans to hand 30 libraries to volunteers has ruled in favour of Lincolnshire County Council.
Campaigners claimed the consultation into the move was unfair and other options were not considered properly.
But council officials insisted the process was fair and the High Court in London has backed this view.
The authority said it needed to save millions of pounds and the library service must play its part.
It was the second time the issue had come to court with campaigners winning the last hearing in 2014, forcing the authority to re-run the consultation.
In a statement, the council’s executive member for libraries, Nick Worth, said: “”We’re delighted with the judge’s decision.
“However, it’s disappointing that at least £350,000 has had to be wasted defending plans that are clearly best for taxpayers, best for library users and best for local communities.
“The delays caused by the legal action have also led to Lincolnshire Co-op withdrawing its bid for Boultham Library, meaning this site is now likely to close.”
Campaigners had described the councils community library plan as a “slow death of Lincolnshire’s library service”.
Julie Harrison, a member of the Save Lincolnshire Libraries group, said: We are so, so sad. We are disappointed and surprised.
“Having sat through the hearing and knowing what was said, I am surprised.”
A two-day hearing last week heard claims the consultation did not make reference to any alternatives, such as an application by a third party company, Greenwich Leisure Limited, to run the service.
Campaigners said this would have kept all the libraries open with paid staff as well as saving the council money.
But the council insisted it obeyed due process. It also said in court “two or three” libraries were ready to be handed over, six had no interest and the rest had not finalised plans.
A judicial review is ordered to assess the technicalities of how a decision is reached, rather than the merits of the decision itself.