Campaigners were celebrating today after winning a High Court battle to block cuts to library services.
But they were warned by a QC that they may have scored an "own goal" and could now face even more draconian cuts when the cases go back for reconsideration.
A judge in London quashed restructuring plans which had been proposed by Somerset County Council and Gloucestershire County Council in an attempt to make cash savings.
It is the third time in a few days that the High Court has struck down controversial bids by financially-squeezed councils to cut costs.
Each time judges have ruled the councils made fatal legal errors and sent them back to the drawing board.
Judge McKenna, sitting as a deputy High Court judge, ruled Somerset and Gloucestershire had failed to comply with "public sector equality duties" owed to vulnerable social groups, including single mothers, children, elderly and the disabled.
The judge declared the decisions were "not merely unlawful decisions, but in substance 'bad government', and it is important to the rule of law to give due respect to these issues of equality".
The ruling means that Gloucestershire council must reconsider its plans to withdraw funding from 10 of its 38 libraries and the withdrawal of its mobile library service.
Somerset must reconsider its plans to end funding for 11 of its 34 static libraries and four of the six mobile libraries already off the road.
James Goudie QC, appearing for the councils, warned the library campaigners that the victory could turn out to be an "own goal" - and even more "draconian" reductions in library services could be introduced.
He said that, when the local authorities came to reconsider their decisions, it was at least "highly likely" they would make the same decisions again.
He said: "They might actually be more draconian from the point of view of those challenging libraries' closures than the decisions made months ago.
"The goal they may have scored (today) may turn out to be an own goal.
"There is no reason to suppose they are are going to practically benefit, given that the financial constraints have obviously not eased."
Campaigners had warned of the disproportionate effect that the cuts would have on disadvantaged groups.
Daniel Carey, of Public Interest Lawyers, said after the decision was announced: "Today's High Court ruling sends a clear message not only to Gloucestershire and Somerset, but to every council in the country that catering for the needs of the vulnerable must be at the heart of any decision to cut important services such as libraries.
"The 'big society' cannot be relied upon to justify disenfranchising vulnerable individuals from the services on which they rely."
The councils were refused permission to appeal but they can apply directly to the Court of Appeal in a bid to take the case further.
The ruling came as campaigners in Brent, north west London, who are fighting to save six "treasured" libraries, await an appeal court decision in their case.
Last Friday a judge ruled Isle of Wight Council's plans to cut social care were unlawful, and two days earlier another judge struck down Sefton Council's plans to freeze fees for local residential care homes.