(Reuters) - A Norwegian man was arrested on Wednesday after sending emails threatening to kill police in Maine with explosives and high-powered rifles, officials said.

Police departments across the United States are on high alert following attacks in Dallas and Baton Rouge last month that killed eight police officers.

Portland police said in a statement that Espen Brungodt, 28, sent the threats to the Portland Police Department and local media outlets around 8:45 a.m. (1245 GMT) on Wednesday and was arrested unarmed and without incident roughly four hours later.

Police said Brungodt entered the United States on July 26 through Boston and was traveling with family members.

The Portland Press Herald newspaper published online a copy of the email it had received from Brungodt, which stated in part: "Time for more police to die."

"Very soon, my partners will head down to Portland Police Department ... There they will shoot and kill as many police officers as they can," the message read, according to the newspaper.

The message also said a nearby parking garage had been booby-trapped with explosives.

Police said the threats prompted the closure of the Cumberland County Courthouse after investigators determined the suspect was likely in the area.

Brungodt faces federal charges related to transmitting threatening communications, Portland police said.

The police statement said local authorities were assisted by the Federal Bureau of Investigation and U.S. Department of Homeland Security.

It was not immediately clear if Brungodt had retained an attorney. A spokesperson for the police department could not be immediately reached for comment.

(Reporting by Curtis Skinner in San Francisco; Editing by James Dalgleish)