Daniel Brydges entered the grounds of the royal residence in central London twice last December.
A man with a “fixation” on accessing royal grounds has admitted twice trespassing at Buckingham Palace.
Daniel Brydges, 33, from Portsmouth, entered the grounds of the central London royal residence on 18 and 22 December last year.
The Queen had been at Windsor Castle on both occasions.
Appearing at Westminster Magistrates’ Court, he also admitted criminal damage to the barbed-wire fence that surrounds the property, on 18 December.
Prosecuting, Sudara Weerasena said security officers had spotted Brydges on CCTV footage on 18 December after he climbed over one fence and scaled another at about 17:00 GMT.
Police officers tracked him down and arrested him. During a police interview about the incident, Brydges told officers he was homeless and looking for somewhere to sleep, she said.
Brydges was bailed on 19 December on the condition that he did not attempt to enter any royal residences.
However, Ms Weerasena said on 22 December at 13:06 GMT, Brydges again scaled The Royal Mews fence and “stooped behind a Land Rover”, before being challenged by a security officer.
“At this point he climbs back over the fence and tries to run away,” she said.
Ms Weerasena said Brydges was chased by the security officer, and later “claimed he had gone in there to collect a bottle of water which he had dropped”.
She said: “The second offence was committed while he was on bail. He was given clear conditions not to enter that area.”
Brydges, of Laburnum Grove, Portsmouth, was bailed until his sentencing at the same court on 9 November.