The government was censured over its anti-terror laws in the courts again yesterday when a judge ruled that five men had had their assets frozen unlawfully after being labelled terrorists by the Treasury.

The five, all British nationals, have never been convicted of any terrorist offence and said the orders had had a "humiliating and devastating" effect.

Mr Justice Collins, sitting at the high court in London, ruled in favour of the men, saying a "fair and just" consideration of who should have their assets frozen was impossible in most cases. He said that the government had bypassed scrutiny by parliament in introducing the orders.

The home secretary, Jacqui Smith, reacted to yesterday's judgment by claiming that it jeopardised public safety.

The government will now appeal to the House of Lords to preserve the power, which was announced by Gordon Brown when he was chancellor.

Since tougher counter-terrorism powers were introduced after the 9/11 attacks, ministers and judges have repeatedly clashed over a range of issues including control orders, detention without trial, and now alleged terrorist financing.

The five Britons, known as A, K, M, Q and G, were designated terror suspects last year under two orders in council. Such orders are not subject to the same parliamentary scrutiny as normal parliamentary legislation, Collins said. The high court said it agreed with the men's lawyers that the government had acted unlawfully, had "bypassed" parliament, and that MPs and peers should have approved the powers.

The judgment criticised the "absurdity" of the way the orders were applied by the Treasury, with one man having to seek a licence to use a car to get his family groceries from a supermarket.

The court heard that the powers cost one man his marriage, while another suffered severe depression.

The act came into UK law in 2006. It was brought into British law to implement UN security council resolutions cracking down on al-Qaida and Taliban funding.

In response, Smith said: "I am very disappointed that the court has challenged the asset-freezing regime. We must be able to use all the tools we can to tackle terrorism and to protect the public."

The Liberal Democrats' home affairs spokesman, Chris Huhne, said: "A crucial difference between this country and a banana republic is that ministers are not allowed to go around arbitrarily arresting people or confiscating their property without due process under the rule of law."

The shadow home secretary, David Davis, said: "The high court has left in tatters the asset-freezing strategy designed by Gordon Brown when chancellor. When you make laws in a hurry that are unfocused and arbitrary, the result is neither firm nor fair - just fragile. "

Seventy suspects are covered by powers to target terrorist funding, and accounts totalling £500,000 have been frozen.