Police have faced criticism of their use of Section 44
Police powers to use terror laws to stop and search people without grounds for suspicion are illegal, the European Court of Human Rights has ruled.
The Strasbourg court has been hearing a case involving two people stopped near an arms fair in London in 2003.
It said that Kevin Gillan and Pennie Quinton's right to respect for a private and family life was violated.
Home Secretary Alan Johnson said he was disappointed with the ruling and would appeal against it.
Chief Constable Craig Mackey of the Association of Chief Police Officers said officers would continue to use stop and search powers while the appeal was pending.
Section 44 of the Terrorism Act 2000 allows the home secretary to authorise police to make random searches in certain circumstances.
But the European Court of Human Rights said the pair's rights under Article 8 of the European Convention on Human Rights had been violated.
The court said the stop and search powers were "not sufficiently circumscribed" and there were not "adequate legal safeguards against abuse".
It also concluded that "the risks of the discriminatory use of the powers" were "a very real consideration".
The pair were awarded 33,850 euros (£30,400) to cover legal costs.
They were both stopped outside the Defence Systems and Equipment International exhibition at the Excel Centre in London Docklands in 2003, where there had already been protests and demonstrations.
Mr Gillan, 32, from London, was detained by police for about 20 minutes as he was cycling to join the demonstration.
Ms Quinton, 39, a journalist from London, was in the area to film the protests. She said she felt she was detained for about 30 minutes, although police records said it was five minutes.
Speaking to BBC Radio 4's The World At One, Ms Quinton said she hoped the ruling would lead to the government drawing up a "fairer body of legislation to protect us".
She said: "The court hasn't said that there's no longer any scope for stops and searches, but that safeguards need to be in place to prevent misuse of these powers, because right now if somebody is stopped and searched, they have got no redress if they feel they were mistreated during the stop and search process.
"It's not about saying that there's no need for stop and search. What we're really saying is people have a right to privacy and there needs to be a balance between police powers to ensure our safety but also our rights to a private life."
Mr Gillan said: "It's fantastic news after a long struggle. I look to the government for a strong response."
Both were represented by Corinna Ferguson, legal officer for Liberty, who said the pressure group had "consistently warned" the government about the "dangers" of the powers.
Ms Ferguson added: "The public, police and Court of Human Rights all share our concerns for privacy, protest, race equality and community solidarity that come with this sloppy law.
"In the coming weeks, parliamentarians must finally sort out this mess."
But Policing and Security Minister David Hanson said he was disappointed at the decision given that the government had won all previous challenges in the UK courts.
He said: "Stop and search under section 44 of the Terrorism Act 2000 is an important tool in a package of measures in the ongoing fight against terrorism."
A statement by the Metropolitan Police said the powers remained "an important tactic in our counter terrorism strategy".
Lord Carlile, the government's independent reviewer of anti-terrorist legislation, told the World At One that the implications of the ruling were potentially "quite serious" and may require a change in the law.
He added: "In my view, section 44 is being used far too often on a random basis without any reasoning behind its use.
"The fundamental point that the court is making is that it increases the possibility of random interference with the legitimate liberties of the citizen.
"On the other hand, we have to be safe against terrorism. There is therefore a very difficult balancing exercise to be done and I'm sure Section 44 will come under intelligent scrutiny in the coming months."
The decision overturned a 2003 High Court ruling - subsequently upheld by the Court of Appeal and the House of Lords - that the use of stop and search, and any consequent violation of human rights, was proportionate under the European Convention on Human Rights and justified in the light of the threat of terrorism.
The Section 44 search powers have proved controversial, and in May last year the Metropolitan Police in London said they would be scaled back.
The force had faced criticism that such searches had been alienating people from ethnic minorities in the capital.
Its commissioner, Sir Paul Stephenson, said the powers should be restricted to "iconic" sites, including Parliament and Buckingham Palace.