PORTLAND, Maine — A Norwegian tourist traveling through Portland with his family was arrested after threatening in an email to kill police officers with explosives and assault rifles, authorities said.

Federal agents and local police arrested Espen Brungodt, 28, without incident at an Old Port hotel where he was staying with his family, who were unaware of his threats, according to Portland police.

Brungodt makes his first appearance in federal court at 2 p.m. Thursday. He faces up to five years in prison and a $250,000 fine, the Department of Justice said Thursday in a news release.

He faces federal charges of transmitting threatening information after police and local media received an email that allegedly said he and his partners intended to use assault rifles to “shoot and kill as many police officers as they can” from atop a parking garage near the Portland Police Department’s Middle Street headquarters, according to The Portland Press Herald, which received the email.

The message claimed the parking garage was booby-trapped with explosives, though police checked the garage — which they closed during the investigation — and found no bombs, Portland police Chief Michael Sauschuck said.

The nearby Cumberland County Courthouse also was closed later in the day when police learned the suspect may have been nearby.

Investigators believe Brungodt, who flew into Boston on July 26 and was scheduled to fly out Thursday, acted alone. He was not armed at the time of his arrest, police said.

“The city of Portland is safe tonight. We believe he was the sole actor in these threats,” Sauschuck said.

The threat put police on high alert, and it came just weeks after two high-profile attacks against law enforcement in other states and one day before Republican presidential candidate Donald Trump was scheduled to hold a rally at Merrill Auditorium.

A gunman shot six officers in Baton Rouge, Louisiana, last month, killing three. That attack came less than two weeks after a sniper in Dallas, Texas, killed five officers and wounded seven others at a previously peaceful Black Lives Matter protest. The Dallas attack has been called the deadliest event for police since 9/11.