Two officers were injured while detaining a man with a knife at the Mall outside Buckingham Palace late Friday night, the Metropolitan Police said.
The two officers suffered injuries to their arms, Met police said. They did not go to the hospital.
The man has been arrested for suspicion of "grievous bodily harm" and assault on police, Met police said.
Buckingham Palace is the home of Queen Elizabeth II. The queen and her husband, Prince Philip, are currently at their estate in Balmoral in Scotland, and no members of the royal family were in residence, Buckingham Palace said.
Met Police said early Saturday that the counter-terrorism unit is now investigating the incident.
Witness Kiana Williamson said she saw officers trying to wrestle a man out of a car that had stopped near the palace. In less than a minute, "the man had been restrained and looked almost unconscious by the side of the road," she said.
Buckingham Palace, which is surrounded by tall gates, has seen past security breaches.
Last year a man convicted of murder climbed a wall and was detained on the palace grounds while the queen was at home.
In 1982 an intruder managed to sneak into the queen's private chambers while she was in bed. Elizabeth spent 10 minutes chatting with him before calling for help.
A palace spokeswoman said the palace did not comment on security issues.