Las Vegas – A British man accused of trying to take a police officer's gun and kill Donald Trump during a weekend rally in Las Vegas will not be released on bail.Federal Magistrate Judge George Foley said at a hearing on Monday that Michael Steven Sandford was a potential danger to the community and a flight risk. Sandford, who wore leg irons and appeared to tremble during the court hearing, is charged with an act of violence on restricted grounds and was assigned a federal public defender.He has not entered a plea.Public defender Heather Fraley said Sandford appeared to be competent and hadn't been diagnosed with a mental illness but has autism and previously attempted suicide. He was living out of his car, didn't have a job and was in the country illegally after overstaying a visa.His mother told court researchers that he was treated for obsessive compulsive disorder and anorexia when he was younger, and that he once escaped a hospital in England, according to the public defender.Planned assassinationFraley argued that 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.Secret Service agents said Sandford went to a Trump rally on Saturday at the Treasure Island Casino and approached a Las Vegas police officer to say he wanted an autograph from Trump. The criminal complaint said Sandford was arrested after grabbing the handle of an officer's gun in an attempt to remove it from a holster.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, area before coming to Las Vegas on June 16.Sandford told officers he had been planning an assassination for about a year and was convinced he would die in the attempt. He said he also reserved a ticket for a Trump rally in Phoenix, scheduled for later in the day, as a backup plan.He told authorities that he went to the Battlefield Vegas shooting range the day before the rally and fired 20 rounds from a 9mm Glock pistol to learn how to use it. Police detectives who visited the range spoke with an employee who confirmed that he provided Sandford shooting lessons, according to the complaint signed by Secret Service Special Agent Joseph Hall.About 1 500 people attended the Las Vegas rally, which was held in the Mystere Theater inside the casino. Attendees had to pass through metal detectors manned by Secret Service, police and casino security officials.