A British man accused of trying to take a police officer's gun and kill Donald Trump during a rally in Las Vegas will not be released on bail.

US Federal Magistrate Judge George Foley said at a hearing on Monday that Michael Steven Sandford, 20, 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 that he 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.