Prince Andrew has accepted an apology from the police after armed officers stopped him in the gardens of Buckingham Palace, days after two men were held in a security breach at the queen's London residence.
The officers had apparently failed to recognise Queen Elizabeth's son, who was strolling the grounds in the late afternoon after attending an event in London on Wednesday.
In a statement, Prince Andrew said: "The police have a difficult job to do balancing security for the royal family and deterring intruders, and sometimes they get it wrong.
"I am grateful for their apology and look forward to a safe walk in the garden in the future."
London's Metropolitan Police earlier confirmed that two of its officers had stopped a man in the palace gardens and asked him to verify his identity, Reuters reports.
The police statement did not name Prince Andrew.
Two days earlier, police arrested a man who had been found inside the palace on suspicion of burglary, trespass and criminal damage. A second man was arrested outside the palace.
The queen was not in the palace at the time.