Unless overturned on appeal, the ruling could lead to pre-payment water devices in thousands of homes nationwide having to be removed, or radically changed so that households cannot be disconnected unlawfully.
Today's test case marked a victory for six local authorities who challenged the legality of the devices, known as budget payment units (BPUs). They cited an "astronomically high and frightening" number of disconnections that posed a threat to public health and increased fire risks.
Mr Justice Harrison declared the BPUs were unlawful because they did not accord with the statutory code of practice for the water industry under the 1991 Water Industry Act.
They failed to comply with "numerous safeguards" under the code intended to protect from disconnection poor families and vulnerable people who got into difficulties with payments.
He overturned a refusal by Ian Byatt, Director General of Water Services, to compel water companies North West Water and Severn Trent to abandon the pre-payment devices.
The water companies argued that the new systems were lawful because BPU customers were never disconnected by the companies, but disconnected themselves when they failed to pay for their smart card, or key, to be charged with "units of credit". The judge described the argument as "superficially attractive, but, in my view, it is not logically correct".
He agreed that the case raised issues of public importance and gave the Director General leave to appeal to the Court of Appeal.
Today's ruling was won by Manchester, Liverpool and Birmingham city councils, Lancashire County Council and Tameside and Oldham metropolitan borough councils. Overall, at least 30 local authorities around the country supported the court action.
Oldham's spokeswoman, Councillor John Johnson, said the decision was "a victory for common sense as it is for the good maintenance of public health".
Birmingham City Council said later its officers had been monitoring "extremely high" levels of disconnections by devices operated by Severn Trent. Council leader Theresa Stewart said: "Naturally we are very pleased at the High Court's decision. We have always felt that it was wrong for the Director General to allow water companies to install these devices and disconnect households who cannot afford to pay their bill.
"It simply did not take into account the need to respect the current customer safeguards which Parliament put in place, or consider the very real public health risks which would follow widespread installations."
The public service union Unison described the ruling as "very good news, particularly for poor families and customers who have difficulty paying their bills". The union's head of water, Alex Thompson, said: "The real danger with the introduction of smart cards is that they become compulsory for customers who get into debt, leading to whole families being left without water."
The judge's decision will come as a blow to the water industry. It had regarded the introduction of BPUs as a success, and warned it would suffer "substantial financial loss, prejudice and hardship" if the new devices had to be abandoned.Reuse content