Royal wedding protesters have lost their High Court claim that they were the victims of unlawful searches and arrests.
The Metropolitan Police were accused of effectively "suppressing anti-monarchist sentiment" when Prince William married Kate Middleton in April last year.
But two judges ruled today the police had acted within their powers and were not guilty of operating an unlawful policy.
Lord Justice Richards and Mr Justice Openshaw, sitting in London, dismissed applications for judicial review from 20 individuals among scores arrested or subjected to searches before or on the wedding day.
The judges declared: "We find nothing in the various strands of the claimants' case, whether taken individually or cumulatively, to make good the contention that the policing of the royal wedding involved an unlawful policy or practice, with an impermissibly low threshold of tolerance for public protests."
Human rights activists say the case has major implications for the policing of other major events, including the Olympics.
Karon Monaghan QC, appearing for the bulk of those detained, argued at a May-June hearing that her clients were all pre-emptively arrested under an unlawful policy to prevent disruption to the wedding.
The signal for their release from custody - without charge - was the "balcony kiss" of the royal couple.
She argued the case touched on "the most important of constitutional rights, namely the right to free expression and to protest, both of which are elemental to a properly functioning democracy".
The judges described the case as "complex". One group of claimants involved 15 protesters arrested at various locations in London, including at a Starbucks in Oxford Street, Charing Cross and those attending the Queer Resistance "zombie picnic" in Soho Square.
The group also included Brian Hicks, 44, a republican with some previous convictions for minor offences when young, but nothing for over 20 years.
The judges said he was arrested and searched on his way to a "Not the Royal Wedding" street party in London's West End organised by the campaign group Republic. He was held at Albany Street police station , where he was subjected to a strip search.
Another claimant was a 16-year-old youth referred to as "M" who was stopped, searched and arrested and detained for nine hours before being released without charge.
He also had his DNA, fingerprints and photograph taken which the police subsequently refused to destroy.
Two claimants, Hannah Pearce and Shirin Golsirat, who were living in squats in Camberwell Road, London, challenged the lawfulness of searches made of those squats under search warrants issued the day before the wedding.
They contended that - although the warrants authorised searches for stolen bicycles, bike parts and computers - the real purpose was to prevent disruption to the wedding.
Another two claimants, Theodora Middleton and Dafydd Lewis, challenged the legality of police searches of a site near Heathrow in west London known as Sipson Camp occupied by environmental campaigners.
The searches were conducted the day before the wedding on a warrant issued by Bromley magistrates which the claimants also said were legally flawed.
But, in a judgment running to 270 paragraphs, the judges dismissed all claims of human rights and statutory violations by the police.
On the major issue of whether the police were operating an unlawful policy to pre-empt wedding day disruption, the judges said they took the view "that all the arrests of the claimants were justified on their facts".
But even if some arrests had been unlawful "it would not support the existence of an unlawful policy or practice".
The ruling was a victory for Met lawyers who argued that the police action was justified and proportionate.
They said a previous direct attack on the Prince of Wales's car in London was one of the factors taken into account when plans were drawn up for policing the wedding.
The event, attended by the royal family, foreign royalty and other heads of state, also came in the violent aftermath of student demonstrations in November-December 2010 and the TUC day of action on March 26 last year.
The police contended that it was clear from contemporary documents and statements from officers that those in charge were well aware of the distinction between lawful, peaceful protest on the one hand and preventing breaches of the peace and criminality on the other.
The Met argued there were "ample grounds" for the searches and arrests of each of the 20 individuals seeking judicial review.
The aim was to prevent what officers "reasonably believed would be an imminent breach of the peace or criminality on the day of the royal wedding".