London - When more than 100,000 flag-waving, cheering royal fans gather for the wedding of Prince Harry to Meghan Markle next month, British police will be treating everyone as a potential terrorist, prankster or royal obsessive.
Barriers to stop vehicle attacks, armed patrols, and airport-style security will be among the measures employed in what will be one of the largest police operations the picturesque town of Windsor has ever seen.
"It is a real challenge," said Bob Broadhurst, a former police officer who was "Gold Commander" in charge of policing the 2011 wedding of Harry's elder brother William to wife Kate.
"It is impossible to search tens of thousands of people who want to come and line the streets, any one of which could be a potential terrorist; someone who's besotted with the royal family - and there are a number of those; or just an attention seeker.
"It's much more of a challenge because essentially everybody in that crowd is a potential terrorist."
Harry and Meghan will tie the knot on May 19 at St George's Chapel in Windsor Castle, Queen Elizabeth's residence which dominates Windsor, about 20 miles (30 km) west of London.
"In the coming weeks and months residents, local businesses and visitors to the town can expect to see an increased police presence, with police officers, both armed and unarmed, search dogs, the mounted section, the roads policing unit and the National Police Air Service," the police said in a statement.
Visitors arriving by car and train on the day will face random searches and "any items that may pose a risk to the public will be removed," they said.
SECURITY TRUMPS CELEBRATION
The conundrum for police will be ensuring that security does not overshadow the event, said Broadhurst, who was also in charge of policing the 2012 London Olympics and the wedding of Harry's father, Prince Charles, to his second wife Camilla in Windsor in 2005.
"Essentially you're managing somebody's wedding and you want it to be joyous and happy for the couple, for the family and for the visitors," Broadhurst told Reuters.
"The trick for those planning the policing of this particular event will be to make the security as unobtrusive as possible so it doesn't impinge on the celebration," he said.
"That is a really tricky thing to do - in this day and age, security must always trump celebration."
Britain is on its second-highest threat level - "severe" - meaning an attack is considered highly likely. Last year there were five incidents classified as terrorism in which 36 people were killed.
Three of those involved a vehicle being driven at crowds, and in two the assailants then attacked passers-by with knives. The move towards such simple tactics poses a greater threat than in the past, Broadhurst said.
"You don't need to have spent hours or months building sophisticated bombs or other weaponry. You just need a kitchen knife, a gun up your jumper, or even just a hire car," he said.
"I very much doubt if the wedding itself will be targeted because of all the security implications, but there's still the town centre, there's still central London. What you don't want is a celebratory event in Windsor and an attack of some sort in London."
In 1981 the queen was shot at by a teenager in New Zealand and the same year six blank shots were fired at her during the annual Trooping of the Colour ceremony in London.
Aside from terrorism, security officials will be concerned about protests - 18 were held on the day of William's wedding amid hostility to the government's austerity measures, Broadhurst said.
Windsor Castle, whose website says it is the oldest and largest inhabited fortress in the world, will provide a secure location for the wedding and reception, but even its walls have been breached.
In 2003, Aaron Barschak, who called himself "the comedy terrorist", managed to bypass castle security wearing a pink dress and an Osama bin Laden-style beard to crash William's 21st birthday party and give him a kiss.
"It can just be a stunt that's not going to harm anybody but it becomes headline news and it kind of then takes the gloss off the wedding itself," Broadhurst said.
"Those reputation issues are always there and what they do is they undermine the confidence of the people in the police and the security services to get things right."
Police commanders will have envisaged all such scenarios during the six months of preparation, but even the best-laid plans can be severely tested.
On the day of William's wedding, minutes before Kate was due to set off, officers discovered a car had been abandoned around the corner and considered sending her a different route - which would have involved missing the crowds. In the end they were able to confirm in time that it was not a security risk.
This time, the tensest moment for the police will be when the newlyweds ride in an open-top carriage through Windsor.
"That will be the bit where the Gold Commander will be holding his breath for a while because it is that point where they are most vulnerable," said Broadhurst.
Given that Britain regularly stages large public events without serious problems, Broadhurst is confident the wedding will pass off without incident.
But he cautioned: "Even with the best of intelligence there is still a small risk, but it's a risk that's accepted by the royal family, it's accepted by the police." (Editing by Guy Faulconbridge and Robin Pomeroy)