20-year-old Michael Sandford told officers he was convinced he would die in the assassination attempt.
A British man arrested at a weekend Donald Trump rally in Las Vegas tried to grab a police officer's gun so he could kill the presidential candidate , according to US authorities.
The 20-year-old man, Michael Steven Sandford, had apparently been planning to assassinate the presumptive Republican nominee for a year.
US Secret Service agents said he approached a Las Vegas police officer at the campaign stop to say he wanted Trump's autograph, before trying to take the weapon.
A complaint filed on Monday in the US District Court in Nevada charges Sandford, 20, with an act of violence on restricted grounds. He was denied bail during a court appearance later in the day. His court-appointed attorney said he was living out of his car in the country illegally after overstaying a visa.
Sandford has not yet entered a plea.
Federal Magistrate Judge George Foley said in court on Monday that Sandford was a potential danger to the community and a flight risk.
'No criminal history'
Heather Fraley, his assigned public defender, said Sandford appeared to be competent. She said he hadn't been diagnosed with a mental illness but that he has autism and previously attempted suicide.
However, Fraley said Sandford's mother told court researchers he was treated for obsessive compulsive disorder and anorexia when he was younger, and that he once ran away from a hospital in England.
The public defender argued Sandford should go to a halfway house because he didn't have a criminal history, but the judge said he should stay in detention ahead of a July 5 court date.
Agents said Sandford told them he had been in the US for about a year and a half, lived in Hoboken, New Jersey, and drove to the San Bernardino, California before coming to Las Vegas on June 16.
Sandford told officers he was convinced he would die in the assassination attempt. He said he also reserved a ticket for a Trump rally in Phoenix, scheduled for later, as a backup plan.
The criminal complaint said Sandford was arrested after grabbing the handle of an officer's gun while trying to remove it from a holster.
According to court documents, Sandford had never used a gun before but went to the Battlefield Vegas shooting range the day before the rally to practice.
In the Trump camp
The attempt on Trump's life follows news that the Republican presidential hopeful on Monday fired his campaign manager, Corey Lewandowski.
The move was another shake-up in a campaign which has been at odds with many senior Republican figures over Trump's policies. The party's nomination convention in Cleveland is less than a month away.
The removal of Lewandowski may help alleviate concerns among party leaders about Trump, who is seen as political outsider, and the conflicting advice he was getting from senior aides.
Trump said Lewandowski did "a great job" but "it's time now for a different kind of a campaign."
"We ran a small, beautiful, well-unified campaign. It worked very well in the primaries. I think I'm probably going to do some of that," Trump said in an interview with Fox News
Lewandowski, 42, had been a near-constant presence at Trump's side since the New York developer launched his campaign on June 2015.
In a brief statement read on CNN, Lewandowski said: "I stand by the fact that Mr Trump is a great candidate and is better than Hillary Clinton ever will be."