Officers were called to the palace’s visitor entrance just before 1pm on Sunday.
The man, 38, had already been stopped by security staff.
He was arrested on suspicion of possessing a firearm (a Taser) and was taken to a central London police station.
The man, who was visiting the UK from the Netherlands, was questioned by police before he was released without further action.
In a statement, the Met Police said: “Officers were satisfied that his possession of the device – which was low-powered and part of a keyring – was a genuine error on his part, and that he posed no threat.”
On its Twitter page, the Metropolitan Police said the incident was not terrorism-related.
Buckingham Palace declined to comment.
The Queen is currently away from her official residence, taking a summer break at Balmoral Castle in Scotland.