A man who pretended he was a senior police officer to get into Windsor Castle has pleaded guilty to impersonating a policeman.
The alleged security scare took place at the castle in May
Michael Hammond, 33, from east London, has also been questioned in connection with suspected hoax calls to police.
The incident occurred shortly after Buckingham Palace appointed a new chief of security as part of a major review of royal protection.
No members of the Royal Family were at the castle at the time of the incident.
To gain access to the grounds on 17 May last year, Mr Hammond called Metropolitan Police officers on duty at the castle.
He pretended 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.
Mr Hammond then approached the side gate with a friend, Tracey Simmonds, 29.
Both of them were dressed in casual clothes and were let through.
Once inside, he made a second phone call to the police posing as the detective and pretending that one of the princes' friends had got lost in the park.
Officers finally caught him red-handed on CCTV while he was on his mobile, again pretending to be the detective.
Mr Hammond is charged with having impersonated policemen in several circumstances over a six-month period in 2004.
The incident took place shortly after Brigadier Jeffrey Cook was appointed security director by Buckingham Palace in the wake of the gatecrashing of Prince William's 21st birthday by stand-up comedian Aaron Barschak.