A Norwegian man charged with threatening to kill Portland police told the officers who arrested him Wednesday that his emails “had the desired effect,” court records show.

Espen Brungodt, 28, made his initial appearance Thursday afternoon in U.S. District Court in Portland to face a charge of sending threatening interstate communications, a felony punishable by up to five years in federal prison and a fine of up to $250,000.

Brungodt wore a yellow jail uniform as he stood next to his attorney, federal public defender David Beneman. Brungodt answered only yes or no questions posed to him by Magistrate Judge John H. Rich III.

Beneman informed Rich during the hearing that while Brungodt is fluent in English, he needed the magistrate judge to speak slowly so Brungodt could fully understand him. Brungodt’s father and acquaintances had said Wednesday that he has been diagnosed with Asperger syndrome, a form of autism.

Brungodt will remain in federal custody at least until the probable cause and bail hearings that are scheduled for Tuesday afternoon.

A prosecutor, Assistant U.S. Attorney Michael Conley, filed a motion with the court seeking to have Brungodt detained while the case against him is pending. In the motion, Conley argues that Brungodt threatened a crime of violence, that he poses a “serious risk” of fleeing and that detention is the only way to ensure public safety.

Conley said in court that the government has taken possession of Brungodt’s passport. The government also has notified the Norwegian consulate of Brungodt’s arrest and its intention to detain him.

Both Conley and Beneman declined to comment on the case against Brungodt after Thursday’s brief hearing.

Details of the accusations against Brungodt are contained in an affidavit by FBI Special Agent Patrick Clancy that was filed with the court in support of the criminal charge.

The affidavit includes the text of an email that Brungodt is accused of sending from a Gmail account in his name, titled “Time for more police officers to die,” to Portland Assistant Chief Vernon Malloch and members of the Portland police, as well as other law enforcement agencies. The email also was sent to two staffers at the Portland Press Herald.

The email said he and an unknown number of partners were “getting our Sig Sauer MCX .223-caliber rifles ready, and very soon, my partners will head down to Portland Police Department on 109 Middle St. There they will shoot and kill as many police officers as they can.”

The messages Wednesday morning triggered a lockdown of the Cumberland County parking garage on Newbury Street while officers with dogs searched for explosives. The nearby Cumberland County Courthouse was evacuated and closed for the remainder of the day as a precaution.

The police department also received a private message on its Facebook account with the same language. The message was sent from a Facebook page belonging to Brungodt, the affidavit said.

Law enforcement officials contacted Facebook and Google, which provided the IP address for the sender’s email and the location where the Facebook page had been accessed. The IP address was traced to the Residence Inn on Fore Street in Portland.

Officials found that Brungodt and two other people entered the United States on July 26 through Boston. The Department of Homeland Security verified that Brungodt is a citizen of Norway and was traveling with two people.

Upon checking the Residence Inn guest register, Clancy found three people had checked into Room 215 on Tuesday.

Brungodt was confronted and arrested in the hotel lobby after being recognized by FBI agents and Portland police sent there to perform surveillance. When asked if there were any immediate threats, he said, “No, it had the desired effect.”

At the police station, Brungodt admitted to sending the emails and the threat posted through his Facebook page, the affidavit said. The court document also said he admitted to creating a Twitter account that sent three tweets Wednesday that also threatened Portland police, saying he created the account for that purpose. He told officers he used his own laptop to send all the threats.