A man was arrested outside Buckingham Palace after throwing suspected shotgun cartridges into Palace grounds, police have said.
A cordon was erected and a controlled explosion was carried out following the incident, which unfolded at around 19:00 BST on Tuesday.
The man was arrested on suspicion of possession of an offensive weapon. There are no reports of any injuries.
Overnight rehearsals for the Coronation on Saturday went ahead as planned.
Police say the man was searched and a knife was found but that he was not carrying a gun. They say he was also found to be in possession of a suspicious bag and that a controlled explosion was carried out as a precaution following an assessment by specialists.
It is understood it is being treated as an isolated mental health incident.
The arrest comes just four days before the King’s Coronation celebrations – which will be attended by world leaders and other royals from around the world.
Security minister Tom Tugendhat described the response as “a fantastic piece of policing”, adding that “a huge security operation” is in place ahead of the Coronation.
“As you saw last night, the police and security services are absolutely ready to intervene when necessary,” he told BBC Breakfast.
The King and the Queen Consort – who live at nearby Clarence House – were not at Buckingham Palace at the time of the arrest, although the King did host Australian Prime Minister Anthony Albanese at the palace earlier on Tuesday.
Chief Supt Joseph McDonald said: “Officers worked immediately to detain the man and he has been taken into police custody.
“There have been no reports of any shots fired, or any injuries to officers or members of the public.
“Officers remain at the scene and further inquiries are ongoing.”
The BBC’s royal producer Sarah Parrish was in the broadcast compound outside Buckingham Palace when she was told to leave and wait outside.
She told the BBC News Channel that those who were evacuated had “heard the controlled explosion and then we were allowed back in again.”
The suspected shotgun cartridges have been recovered and will be examined by specialists. Roads in the area have now reopened and the cordons have been lifted.
Buckingham Palace has declined to comment.
Rehearsals for the Coronation saw soldiers dressed in bright yellow and red uniforms file past the palace and along the Mall in the early hours of Wednesday morning.
The parade also featured soldiers on horseback and the Diamond Jubilee State Coach, which will carry the King and Queen Consort from the palace to Westminster Abbey.
Extra security is expected in the capital for the Coronation, which policing minister Chris Philp has described as a “huge policing operation”.
Asked about the prospect of protesters disrupting the weekend’s events, Maj Gen Chris Ghika, a senior British Army officer overseeing the ceremony, said the Metropolitan Police has “an excellent security plan in place, which will allow the parade to go ahead”.
Chris Phillips, former head of the UK National Counter Terrorism Security Office, told the BBC that police have been planning for the Coronation for years and that an “enormous amount of planning” has gone into the security operation.
“The police should be celebrated for it, and fingers crossed it all goes well on Saturday,” he said.