A man who posed as a senior officer to get into Windsor Castle after a series of police hoaxes has been jailed for four-and-a-half years.
Hammond posed as a senior detective to gain entry to Windsor
Conman Michael Hammond, 36, from Cubitt Town, east London, was sentenced at Isleworth Crown Court on Friday.
Hammond had pleaded guilty to one count of being a public nuisance - which included 11 impersonations of police officers and wasting police time.
Sentencing him Judge McGregor-Johnson said the public must be protected.
"On three occasions innocent people were stopped at gunpoint because of what you said and pretended to be," he told Hammond.
"Quite apart from the stress and fear that must have caused those people, you created the risk of something much worse."
The 36-year-old - said to have previously posed as a millionaire playboy - made 133 hoax calls, for assistance and reporting sightings of criminals and murder suspects.
Members of the public were searched at gunpoint and armed emergency units despatched several times.
On 17 May 2004 Hammond conned his way into Windsor Castle by pretending to be a well-known senior police officer, Detective Superintendent Simon Morgan, and said he was accompanying friends of the princes who did not wish to use the main entrance.
Mr Morgan is in charge of the investigation into Britain's most prolific sex predator, who often attacks elderly women.
No members of the Royal Family were at the castle at the time of the intrusion, but the Queen had left just hours earlier.
Hammond was arrested after officers caught him on CCTV in the grounds of Windsor Castle, on his mobile phone pretending to be the detective.
The incident occurred shortly after Buckingham Palace appointed a new chief of security as part of a major review of royal protection.
Outside of court, Hammond's legal team confirmed that an appeal would be made.