Police said the incident was not being treated as terrorism-related.
“Officers worked immediately to detain the man and he has been taken into police custody,” Chief Superintendent Joseph McDonald said in a statement. “There have been no reports of any shots fired, or any injuries to officers or members of the public.”
King Charles III and Camilla, the queen consort, were not at Buckingham Palace at the time of the arrest. Palace officials declined to comment, saying the incident was a police matter.
Cordons were erected in the area late Tuesday. Police said officers remained at the scene and investigations were ongoing.
The incident took place just days ahead of Charles’ coronation ceremony, which is scheduled to take place at nearby Westminster Abbey on Saturday.
In recent days Buckingham Palace has seen a flurry of activity as tourists and international media begin to descend for the coronation — the first to take place in the country since Queen Elizabeth II was crowned in 1953.
Dozens of foreign royals, dignitaries and heads of state are expected to travel to the U.K. to attend the event, set to be a huge policing operation.
On Saturday Charles and Camilla will ride in a gilded coach from the palace to Westminster Abbey, where they will be crowned in a ceremony steeped in history. The pair will then return to the palace, escorted by a spectacular military procession featuring thousands of ceremonial troops, before they appear on the palace balcony to greet well-wishers.