The 44-year-old tried to enter via the north centre gate of Queen Elizabeth II's central London home but was stopped immediately.
Palace authorities said the monarch was not in the building during the incident.
"I can confirm that the Queen was not in residence when the incident happened but other than that we are not commenting," a palace spokesperson said.
"The man was searched and found to be in possession of a knife, which was seized. He was arrested on suspicion of trespassing on a protected site and possession of an offencive weapon," the Metropolitan Police said in a statement.
More From This Section
The incident is the latest in a series of security scares involving Britain's royal family.
Last month, a burglar broke into Buckingham Palace after climbing a wall and kicking open a door.
The man was arrested in a royal state room on suspicion of trespass, burglary and criminal damage after police were alerted.
A suspected accomplice was held in the street outside the royal residence and arrested on suspicion of conspiracy to burgle.
The most famous breach, however, was by Michael Fagan back in 1982, when he broke into the Queen's bedroom.