The incident happened on Wednesday night shortly before midnight, Scotland Yard said.
"Shortly before midnight on Wednesday 11 December a man was stopped within the precincts of St James's Palace by a police officer," a Metropolitan Police spokesman said.
"He was questioned and his identity established.
"He was escorted from the premises."
Princess Anne
Police could not confirm one report that the man was only apprehended after he started drunkenly knocking at the door of the Princess Royal, apparently to ask for directions to Victoria Station.
The spokesman said inquiries were continuing into how the intruder gained access to the Palace.
He added that no officers had been suspended as a result of the incident.
St James's Palace declined to comment on security issues.
The News of the World reported that a drunken Christmas party reveller stumbled into the precincts of the palace past a police checkpoint.
They quoted "a royal aide" as saying: "The man was very confused and thought he'd found a short cut to the station.
"He got right up to Princess Anne's front door and knocked to ask for directions. But he was arrested before anyone answered."