Prince Andrew has said he is grateful for an apology offered by armed police officers who confronted him in the grounds of Buckingham Palace, demanding to know who he was.

The incident last Wednesday was the second in quick succession to cause Scotland Yard embarrassment over its royal protection operations – coming just two days after an intruder scaled the walls of the Queen's home.

The Duke of York said the police sometimes got it wrong but he was "looking forward to a safe walk in the garden in the future". His comments came after Scotland Yard launched a security review in response to the earlier incident.

Police confirmed that the intruder and one other man had been arrested last Monday after the most serious security breach at the Queen's official residence in more than 30 years. And, less than 48 hours later, officers confronted the Duke of York after failing to recognise him as a member of the royal family.

Scotland Yard said no weapons were drawn and no force was used in verifying the identity of the duke.

Prince Andrew was at Buckingham Palace following an engagement supporting new business ventures in Piccadilly in central London. Police said no members of the royal family were present during the earlier intrusion. The Queen was at her Scottish residence at Balmoral Castle, where she usually stays during August and September.

As news of the break-in emerged, she made her traditional appearance at a Highland Games. She was joined by the Duke of Edinburgh and the Prince of Wales at the Braemar Gathering in Aberdeenshire, where the royal party watched pipe bands and dancers perform to a large crowd.

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."

The Sunday Express quoted an anonymous "royal insider" as saying that the Duke of York was "unhappy" about being confronted and said the two police officers involved were "highly embarrassed" by their failure to recognise the prince.

The newspaper reported the source as saying: "From what we've all heard the duke was absolutely livid and tore them off a strip."

A Scotland Yard spokesman said: "On Wednesday 4 September at approximately 1800 two uniformed officers approached a man in the gardens of Buckingham Palace to verify his identity. The man was satisfactorily identified. No weapons were drawn and no force was used."

On Monday's break-in the spokesman said: "One man, 37, was arrested for burglary, trespass and criminal damage after scaling a fence at the venue. He was found inside the palace in an area currently open to the public during the day. The second man, 38, was arrested for conspiracy to commit burglary outside the palace.

"Both men have been bailed to return to a central London police station in mid-October and inquiries continue. A review of the specific circumstances of this incident is being carried out."

The break-in is one of the most serious security breaches at the palace since 1982, when Michael Fagan evaded guards to get inside the Queen's private chambers while she was still in bed.