A London court heard how the terrifying incident unfolded on October 7, when Daniel Sheehan, 22, was arrested while scaling the south gate of the Queen's home at 1:45pm.
In the aftermath Sheehan, unarmed at the time, issued a chilling warning to the officers guarding him, claiming: "I will get a gun, I will use it at the palace to defend myself. I have not got one yet but I will get one."
When appearing at Westminster Magistrates' Court, the crazed Sheehan refused to give his name, and shook his head when asked to confirm his details.
Prosecutor Kevin Christie revealed that Sheehan was discharged from Langley Green Hospital in Crawley, England, on October 6.
The institute is described as being a state-of-the-art hospital specializing in treating people with acute mental health problems.
- Kate Middleton 'Doing Well' Despite Prince William Pulling Out of Royal Service in the Eleventh Hour
- Royal Gaffe: Prince William Mocked Over Awkward Remarks to Actress Mia McKenna-Bruce
- WILLIAM BLOCKS HARRY RETURN: Prince William has ‘Made It Clear That There is no Longer a Place’ for Brother in Royal Family
"This offense happened the next day," Christie said.
The troubled man was ordered by Judge John Zani to undergo psychiatric evaluation and will remain in custody until October 13.
Sheehan appeared in court with blonde hair, gray sweatpants and a tee-shirt. He had no fixed address, and faces two charges of trespassing.
Security at Buckingham Palace and Westminster are on high alert since the recent terror attacks around Europe.
We pay for juicy info! Do you have a story for RadarOnline.com? Email us at email@example.com, or call us at (866) ON-RADAR (667-2327) any time, day or night.