A Norwegian man charged with threatening to kill Portland police officers told the officers who arrested him in the lobby of the Portland hotel where he was staying Wednesday that his emails “had the desired effect.”

An affidavit in support of the criminal complaint against him was filed by FBI Special Agent Patrick Clancy and showed that Espen Brungodt sent the emails, titled “Time for more police officers to die,” to Portland Deputy Police Chief Vernon Malloch and members of the Portland Police as well as other law enforcement agencies and the Portland Press Herald from a Gmail account in his own name.

The email went on to say that 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 triggered a lockdown of the Cumberland County parking garage on Newbury Street Wednesday morning 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 Portland Police Department also received a private message on its Facebook account with the same language, from a Facebook page belonging to the 28-year-old Brungodt, according to the affidavit.

Law enforcement officials contacted Facebook and Google, which provided the IP address for the email address 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 U.S. on July 26 through Boston. The Department of Homeland Security verified that Brungodt is a citizen of Norway and was traveling with two other people.

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

Brungodt was confronted by FBI and Portland Police in the lobby of the hotel and handcuffed. When asked if there were any immediate threats, he said, “No, it had the desired effect.”

At the police station, Brungodt admitted to the emails and the threat posted through his Facebook page. He also admitted to creating a Twitter account that tweeted three messages Wednesday that also threatened Portland Police, saying he created the account for that purpose, according to the affidavit. He told officers he used his own laptop to send all the threats.

Brungodt is scheduled to make his first appearance in U.S. District Court in Portland Thursday.

This story will be updated.