A young girl and her family who took on Northamptonshire county council over its plans to close 21 libraries have claimed a win in the high court, after a judge ruled that the cash-strapped council would have to revisit its plans while “paying attention to its legal obligations”.

Mrs Justice Yip, announcing her judicial review judgment on Tuesday, found that the council’s decision-making process had been unlawful, and that it had not properly considered whether it would be operating a comprehensive and efficient library service – as required by law – once the much-criticised closures had gone ahead.

Two separate legal challenges had been made against Northamptonshire’s plans to close 21 of its 36 libraries. The changes would leave Northamptonshire with eight large and seven medium-sized branches, or one library for every 60,000 residents. According to the all-party parliamentary group for libraries, the European average is one library per 16,000 people.

If the cuts were to go ahead, it would also affect the county’s children’s services, with 13 of the 21 affected libraries also housing children’s centres, which provide activities, education and care.

Yip said that the council’s “flawed” decision-making showed that “the whole question of library provision needs to be revisited by the defendant, paying attention to its legal obligations and all material considerations”. While saying the closures may still go ahead “provided that decision is reached lawfully”, Yip gave both sides more time to consider which decisions made by the council should be quashed by the high court, and what relief should be granted.

While Yip found that the council’s plans allowed for possibly relocating the 13 children’s centres, “the reality, it appears, is that the defendant did not and still does not know what will happen and what costs will be involved”.

Northants council, which is technically insolvent, was told in February by its auditors, KPMG, that its proposed 2018-19 budget was not achievable. The council subsequently abandoned its plans to allow some of the threatened 21 libraries to remain open or run by volunteers, and adopted a more drastic option, which allowed no financial support for community managed libraries.

On the evidence before me, I am not satisfied that the cabinet appreciated what they had to decide Justice Yip

Yip said in her judgment that the difficulty began after KPMG’s advisory notice. “I appreciate the real pressure the cabinet and the defendant’s officers were operating under at the time. However, this did not relieve the defendant of the need to act lawfully,” she wrote, adding that the decision to close the libraries “appears to have been taken without balancing the statutory duty against the financial pressures”.

“The cabinet cannot be criticised for being motivated by financial concerns. However, finances could not be the sole consideration. [It] still had to be satisfied that they were complying with their legal duties. On the evidence before me, I am not satisfied that they appreciated what they had to decide,” she wrote.

Irwin Mitchell lawyer Caroline Barrett, representing the family who can’t be named for legal reasons, said the ruling vindicated the concerns of local residents.

The child’s mother said she was “absolutely delighted … We have fought hard against the proposed unfair cuts to our much loved library service. The closures would have had a devastating impact on families like ourselves, but also on the most vulnerable people within our community.”

“The libraries offer us so much more than just books. They offer residents access to the relevant district council’s one-stop shop, blue badge and bus pass renewal, children’s services and plenty more services that residents rely on. It is well known that the council is in a difficult financial position but it simply did not think about the impact of these cuts and the effect that they would have had on local communities.”

Last week, the crisis-ridden council voted to cut £70m from its £440m budget over the next few months, which will reduce its services to the bare legal minimum. The cuts are intended to help cover a financial black hole that could grow to £180m in the next three years, according to the council.

The council is currently identifying its priority areas of spending, and has said that no library closures, “temporary or otherwise, will take place until this work is complete, subject to staffing levels”, according to Yip’s ruling.

Nick Poole, chief executive of librarian body Cilip, said: “As communities across the country continue to experience the impact of austerity measures on public services, the high court ruling that Northamptonshire’s proposal to close 21 libraries was unlawful sends a clear message that financial pressures do not absolve local authorities from their statutory duty to provide comprehensive and efficient library services. Every community has the right to benefit from a quality local library service and we will continue to work with national and local government to ensure that the necessary funding and support are available to guarantee this.”

In a statement, the council said it was continuing to work closely with community groups following the judicial review judgement.

Northamptonshire leader Matthew Golby said he was pleased by the ruling: “The county council is committed to finding a way forward that is satisfactory and achievable for all parties.”