Supporters of US President Donald Trump climb a wall during a protest against the certification of the 2020 presidential election results by the Congress, Capitol. [Reuters]

A man appointed to the U.S. State Department during the Trump administration will remain in jail while he awaits trial on charges that he took part in the deadly storming of the U.S. Capitol and assaulted police officers, a judge said on Tuesday.

US Magistrate Judge Zia Faruqui in Washington said during a court hearing that he was denying a request by Federico “Freddie” Klein, 42, for pretrial release.

The judge said Klein’s status as a government employee at the time of the Jan. 6 attack was troubling and suggested he would pose a danger to the public if released.

Faruqui said Klein “swore an oath to protect America” but instead “switched sides” and joined forces with domestic enemies during the attack on the Capitol, which left five people dead.

“How could someone sworn to protect the Constitution against all enemies, foreign and domestic, then participate in an attempt to stop the administration of the Constitution?” Faruqui said.

Klein, who had a top-level security clearance, served as a State Department political appointee from 2017 until his resignation on Jan. 19, the day before former President Donald Trump left office.

Klein worked as a special assistant in the Office of Brazilian and Southern Cone Affairs.

Before that, Klein was an employee of Trump’s 2016 election campaign.

Federal prosecutors allege Klein assaulted police officers with a riot shield and jammed it into doors at the Capitol.

Klein ignored commands to back down and encouraged others to clash with the police, according to prosecutors.

“We need fresh people, we need fresh people,” Klein shouted repeatedly, according to the criminal complaint against him.

Klein’s lawyer said during the court hearing that the government had failed to show that Klein poses a danger to the community. Klein can appeal the judge’s order.