A man has been arrested on suspicion of burglary, trespass and criminal damage after scaling a fence to get into Buckingham Palace, police have said.
He was found "in an area currently open to the public during the day" at about 22:20 BST on Monday, the Metropolitan Police said.
A second man was arrested outside the Queen's home on suspicion of conspiracy to commit burglary.
The Met said both men were bailed and a review into the incident was under way.
A spokesman said police inquiries were continuing.
"A review of the specific circumstances of this incident is being carried out," he said.
"No members of the Royal Family were at Buckingham Palace at the time of the incident."
The spokesman added that security would form part of the review.
Buckingham Palace has not issued any comment.
The Queen and Prince Philip spend August and September at Balmoral Castle on the Balmoral Estate in Aberdeenshire.
Buckingham Palace is the best known of the Queen's three official residences, serving as a family home and the administrative headquarters of the monarchy.
The palace's "state rooms" - those designed for monarchs to "receive, reward and entertain their subjects and visiting dignitaries" - have been open to the paying public during August and September for 10 years.
Profits initially helped to pay for the restoration of Windsor Castle, which was fire-damaged in November 1992, and now go to the Royal Collection Trust charity, which manages the Royal Collection - "one of the most important art collections in the world".
Security has been breached on a number of occasions at the palace, most famously in 1982 when Michael Fagan broke into the Queen's bedroom.
The monarch woke to find Fagan, 30, sitting on her bed, and the pair reportedly chatted for half an hour before Fagan was arrested.
Last year, Oscar-winning actress Emma Thompson played the Queen in Sky Arts TV drama Walking the Dogs, which was based on the incident.
An escaped psychiatric patient has also managed to get in the grounds, and on another occasion a group of anti-nuclear demonstrators scaled the walls with ladders and held a sit-down protest on the lawn.
A number of tabloid journalists have also managed to gain access over the years, including Daily Mirror reporter Ryan Parry who spent two months working undercover as a footman.