Campaigners have lost their High Court bid to save six libraries in north-west London which were marked for closure to cut council spending.
Brent Council announced plans to shut half of its libraries in April.
Brent SOS Libraries sought the judicial review, arguing the decision failed to assess local needs and the impact of the closures.
The council confirmed the libraries had been closed following Thursday's ruling and were "being made secure".
The authority's lawyers had argued the decision was "rational".
A Brent Council spokeswoman said "all the six libraries which the executive decided to close in April are now closed, and are being made secure" after protesters reported that libraries were being "boarded" and "locked-up".
About 150 protesters gathered outside Kensal Rise library to demonstrate against the decision.
Brent Libraries SOS campaign spokeswoman Margaret Bailey said: "At about 14:00 BST builders arrived who wanted to board up the windows and doors.
"But they were reluctant to cross the protest line."
Ms Bailey said the protesters were "shocked that the council had moved so quickly" to close the libraries "before the protesters had had a chance to launch an appeal".
"We are determined to appeal," she added.
The case was being seen as a test case for other campaigners across the UK fighting to keep 400 libraries open.
Mr Justice Ouseley ruled there was no evidence to support the serious allegations made against the authority.
John Halford, solicitor for the campaigners, said: "Today's judgement means that half of Brent's libraries remain under threat and has very troubling implications for library closure decisions nationally."
Councillor Ann John, leader of the Labour-run council, said: "We are pleased that the judge, having carefully considered all the complaints, has found in the council's favour on each and every one."
The council wanted to close the libraries in Kensal Rise, Barham Park, Tokyngton, Preston, Cricklewood and Neasden by September.
Liberal Democrat MP for Brent Central, Sarah Teather, who is also Minister of State for Children and Families, said: "Local residents have made their opinions clear - they want the libraries to stay open and are willing to fight to make that happen - it is a real shame that Labour-run Brent Council are refusing to listen."
Celebrities such as playwright Alan Bennett, singer Nick Cave and the bands Depeche Mode, the Pet Shop Boys and Goldfrapp had backed the campaign, with many contributing to the costs.
Helen Mountfield QC, for the residents, argued Brent Council had adopted "a fundamentally flawed and unlawful approach to the making of savings in its budget" and the local authority had failed to comply with equality legislation and consult the local community properly.
But council lawyers said the decision was "rational, made with great care and was based on a full appreciation of the obligation to act within the law" and the judge ruled in the authority's favour.
Ms John said: "It means we can push ahead with our exciting plans to improve Brent's library service and offer a 21st Century service for the benefit of all our residents."
Ms Bailey said: "We believe that there are important points of principle at stake which an appeal court will decide differently.
"Our campaign will redouble its efforts to expose the senselessness of Brent Council's decision to close half of its libraries."
Paul Lorber, leader of the Liberal Democrats on the council, said: "We are determined to save our libraries in Brent irrespective of what the Labour administration is doing."
The Department for Culture Media and Sport said it was considering the judgement.