The man arrested after trying to enter Buckingham Palace with a knife just wanted to see the Queen, a court has heard.
David Belmar admitted trespass and possession of a bladed article at Westminster Magistrates' Court today.
Edward Aydin, prosecuting, told the court: "In police custody, he said to police 'I wanted to see the Queen. I'm not happy about my benefits'."
An armed police officer stands guard after the attempted entry on Monday
He added that Belmar, who has mental health issues which he is taking medication for, has a fixation with the Queen and received a caution in 1989 for lighting fireworks and throwing them into the grounds of Buckingham Palace.
The 44-year-old from Haringey, north London, was watched by a crowd of around 20 tourists as he tried to run through the palace's north centre gate just before 11.30am yesterday.
When police searched Belmar after bringing him to the ground, they found the kitchen knife wrapped in a plastic bag in his jacket pocket.
The Queen was not in the building at the time of yesterday's incident, Buckingham Palace said.
District Judge Quentin Purdy adjourned sentencing so that pre-sentence reports could be carried out.
TODAY'S TOP STORIES
He remanded Belmar in custody until he is sentenced at Southwark Crown Court at a date yet to be set.
Belmar, who appeared in court wearing a black jumper with an Umbro logo and blue jeans, went to the front of Buckingham Palace at 11.29am, Aydin said.
He told the court Belmar, who is of a stocky build, was seen to suddenly break into a run.
"He then turned into the grounds of the palace and jumped over the vehicle barrier by putting his foot on that barrier," said Aydin. "Two police officers, armed, one of them shouted: 'Stop!' - he continued to run.
"As you can see he's quite a large man. He was rugby tackled to the ground because he wouldn't stop. Police called out on two occasions."
He added that other officers rushed to help apprehend Belmar.
A number of children were at the gates of the palace watching while the incident was unfolding, the court heard.
"Armed guards had to stop him," said Aydin. "He could have been fired upon. Other people could have been hurt.
And there was a risk of some form of disorder there outside the palace."
Belmar was under the care of mental health services from 2002 to 2010 and lives with his father and brother, both of whom sat in the court's public gallery for today's hearing.
Aydin said Belmar was a man with a long history of mental illness who is a danger to himself.
He added: "His behaviour that morning, yesterday, was unpredictable.
"He is a danger to the public, carrying a knife in central London, and he is a danger to the Queen."
Robert Katz, defending, denied Belmar has a fixation with the Queen or Buckingham Palace, as it was claimed.
He said his client had been on incapacity benefit for the past 10 years but that it was stopped after he was assessed in September.
Katz said: "He became very upset by that decision and he didn't know how he was going to cope."
He added that Belmar did not brandish the knife and was not going to use it, but that he had "wanted to draw publicity to what had happened to him".
Belmar, who admitted trespass on a protected site and possession of a bladed or pointed article, has a number of previous convictions, including for actual bodily harm and criminal damage.
Aydin told the court that Belmar becomes violent when taking some of his medication for mental health problems.
District Judge Purdy said the case was too serious to be dealt with in the magistrates' court, given his past convictions.
Making his decision to remand Belmar in custody, he accepted he was living in the community on prescription medication but added: "Something has clearly gone wrong.
"If it could go wrong yesterday, being granted bail there is a real risk, until he is properly assessed and perhaps further medication prescribed.
"He is a danger not just to himself but to others."
Last month, a separate security incident was sparked at the palace when a suspected burglar got into the building by scaling a fence.
He was found at around 10.30pm on September 2 in a room that had been open to the public during the day. A second man was arrested outside the palace on suspicion of conspiracy to commit burglary.
Less than 48 hours later, amid heightened security, two police officers confronted the Duke of York in the palace gardens demanding to know who he was.
Scotland Yard later issued a public apology to the Duke, and in response he issued a statement saying protection officers have "a difficult job" and he was grateful that the force had apologised.