The federal E. Barrett Prettyman U.S. Courthouse in Washington. (Susan Walsh/AP)

A California man pleaded not guilty to acting as a covert agent of the government of Iran and was ordered detained Tuesday by a U.S. judge on charges of secretly monitoring a Jewish center in Chicago and American members of an exiled Iranian opposition group.

U.S. Magistrate G. Michael Harvey of the District of Columbia said the case as alleged bore “hallmarks of state action,’ and ordered Majid Ghorbani, 59, held until trial.

The judge cited the purported use of code names, countersurveillance tactics and “tasking” orders to infiltrate the Mujahideen-e Khalq (MEK), or People’s Mujahideen of Iran, a dissident group that seeks regime change in Iran.

Ghorbani, an Iranian citizen and permanent U.S. resident of Costa Mesa, Calif., and co-defendant Ahmadreza Mohammadi Doostdar, 38, a dual U.S.-Iranian citizen, were arrested Aug. 9 and indicted Monday on charges of acting as agents of Iran, violating U.S. sanctions, and conspiracy.

Doostdar is set to appear in federal court Wednesday in Chicago.

Although the men are not charged with espionage, prosecutors told the court they intend to use information obtained under the Foreign Intelligence Surveillance Act, which allows collection of electronic communications overseas. Ghorbani’s home and Doostdar’s luggage were searched surreptitiously, and U.S. authorities recorded conversations the men conducted on pay phones and in their vehicles.

In a statement Tuesday, the National Council of Resistance of Iran, a Paris-based group linked to the MEK, called the defendants Iranian Intelligence Ministry agents. The group, two of whose members were allegedly targeted by the operation, likened the case to those of two people arrested and charged with plotting to bomb an MEK rally in France in July and two others accused of terrorism against the group in Albania in March.

“The Iranian Resistance once again reiterates the need to prosecute and expel all the regime’s Intelligence Ministry and Quds Force agents and all known and undercover agents and mercenaries who pursue the regime’s plots in the U.S. and Europe,” the group said.

In an hour-long hearing in federal court, Assistant U.S. Attorney Erik Kenerson said that Ghorbani posed a serious risk of flight and that his charges carried a statutory maximum of 35 years in prison if run consecutively.

“The [U.S.] government cannot stop him from going into a consulate, embassy or the Iranian interests section” of the Pakistani Embassy in Washington, nor from obtaining a new Iranian passport and leaving the country, Kenerson said.

“There’s no force field that prevents him from doing anything,” he added, including continuing to put at risk “U.S. citizens on American soil for exercising their constitutional rights.”

According to charging documents, Doostdar entered the United States in about July 2017, allegedly to gather intelligence about targets considered enemies of the Tehran government, and made contact with Ghorbani.

Prosecutors translated Ghorbani’s recorded remarks in Farsi as saying he “penetrated” the MEK to send information back to Tehran for “targeting” packages — data the FBI said can be used for the neutralization, arrest, recruitment, or cyber exploitation of a target, as well as “capture/kill operations.”

The FBI said Ghorbani named two Washington-based men he surveilled, Alireza Jafarzadeh, deputy director of the NCRI’s Washington office and an MEK spokesman, and Ali Safavi, president of the Near East Policy Research consulting firm in Washington and a member of the NCRI’s foreign affairs committee.

Ghorbani, prosecutors said in a court filing, “noted of one of the subjects, ‘[expletive] is . . . working for Mossad now . . . he is one of those [expletive] Jews . . . I swear; [expletive] needs one — one shot.”

Ghorbani’s attorney, Assistant Federal Defender Mary M. Petras, said that Ghorbani’s alleged statements were translated and out of context, and she denied that he posed a serious risk of flight. He has lived for 20 years in the United States since immigrating with his parents, sister and brother, lives with his younger brother in Orange County, Calif., and worked as a waiter at the same restaurant for a decade, she said.

Petras noted that Ghorbani’s daughter and her fiance were present in the courtroom, traveling from their home in California to support her father.

Prosecutors alleged that Ghorbani was paid $2,000 by Doostdar in late 2017 after turning over photographs of demonstrators at a Sept. 20, 2017, rally in New York City against the Iranian government. An FBI affidavit also said that Ghorbani traveled to Iran to conduct an “in-person briefing” in March and allegedly discussed clandestine methods to provide photos he took of an Iran Freedom Convention for Human Rights in Washington, D.C., on May 4.

Both events were supported by the MEK, which was listed by the State Department as a terrorist group from 1997 until 2012.

However, Petras said that Ghorbani is accused of taking “photographs of two events” and “two known individuals,” containing information that is publicly available on the Internet, including in videos and data “uploaded by MEK itself.”

Petras said there is no evidence that Ghorbani traveled to meet with any agent of the Iranian government, as opposed to a possible government supporter, or opponent of MEK.