GREENBELT, Md. (AP) — A Coast Guard lieutenant accused by prosecutors of being a domestic terrorist intent on committing politically motivated killings inspired by a far-right mass murderer was sentenced Friday to more than 13 years in prison for firearms and drug offenses.

Christopher Hasson, 50, had faced a maximum prison sentence of 31 years at sentencing by U.S. District Judge George Hazel. The severity of Hasson’s sentence hinged on two starkly divergent explanations for the cache of weapons seized from his Maryland home and the disturbing material found on his computer at Coast Guard headquarters in Washington.

Hazel, who sentenced Hasson to 160 months, said he believes the officer was preparing to carry out a “mass casualty assault as a way to act out his white nationalist views.”

“The need to protect the public is of paramount importance,” the judge said.

Hasson, in his first public comments since his arrest, said he has never harmed anybody in his life and wasn’t planning to hurt anyone “in any way, shape or form.” But he apologized to his family, his colleagues and to the public, saying he knew his actions alarmed many people.

“I am embarrassed by these things and sorry for the pain they have caused,” he said.

“Any semblance of hate, bigotry or advocacy of violence has no place in our Coast Guard,” said Adm. Karl Schultz, the guard’s commandant, in an emailed news release. “This includes involvement with white supremacist or extremist groups of any type. This behavior is incompatible with the Coast Guard’s Core Values of Honor, Respect and Devotion to Duty.”

He said Hasson is being “involuntarily separated” from the Coast Guard without “any rights, benefits and retirement pay, which he may have otherwise been entitled.”

Federal prosecutors recommended a 25-year prison sentence. They have called Hasson a domestic terrorist and self-described white nationalist, intent on carrying out mass killings. But they filed no terrorism-related charges against him.

Assistant U.S. Attorney Thomas Windom said Hasson intended to “strike a blow to the American government in hopes of subjugating, intimidating it.”

Defense attorneys urged Hazel to spare Hasson from prison and sentence him to jail time served since his February 2019 arrest. Hasson’s lawyers accused Justice Department prosecutors of fabricating a bogus narrative that the married father of two grown children was planning a terrorist attack.

“Mr Hasson has been punished enough,” said one of his lawyers, Liz Oyer. “His reputation has been permanently wrecked, His career is over.”

The judge said the sentence isn’t designed to strike a larger blow against hate in the U.S., where he said the seeds of white supremacist ideology “have grown and produced dangerous fruit” over generations.

Hasson’s case is among a recent string of FBI domestic terrorism investigations. Over the past few months, agents have arrested several people, mostly young men, linked to violent neo-Nazi and white nationalist groups called Atomwaffen Division and The Base. Three men accused of being members of The Base were arrested in Maryland and Delaware on Jan. 16 after a hidden camera captured two of them discussing how violence at a gun rights rally in Virginia could start a civil war.

Prosecutors haven’t linked Hasson to any particular extremist group, but said he has been a “closet skinhead” his entire adult life.

Hasson pleaded guilty in October to possessing unregistered and unserialized silencers, being a drug addict in possession of firearms and illegal possession of tramadol, an opioid painkiller.

In September, Hazel refused to dismiss Hasson’s gun charges.

In an earlier court filing, prosecutors said Hasson “intends to murder innocent civilians on a scale rarely seen in this country.” They also said Hasson drafted a June 2017 email in which he said he was “dreaming of a way to kill almost every last person on the earth.”

“Start with biological attacks followed by attack on food supply,” he wrote.

Prosecutors said Hasson appeared to be planning attacks inspired by the manifesto of Anders Behring Breivik, the Norwegian far-right terrorist who killed 77 people in a 2011 bomb-and-shooting rampage.

READ MORE: Portland mayor calls for probe into texts between police, far-right group

Prosecutors also claimed Hasson drew up what appeared to be a computer spreadsheet hit list naming House Speaker Nancy Pelosi, Senate Democratic Leader Chuck Schumer and Democratic presidential hopefuls, including Elizabeth Warren. He also mentioned several network TV journalists, including MSNBC’s Chris Hayes and Joe Scarborough and CNN’s Chris Cuomo and Van Jones.

In February 2018, Hasson searched online whether Supreme Court justices are “protected,” two weeks before he searched for the home addresses of two Supreme Court justices, according to Windom.

Hazel said Hasson’s searches for the home addresses of Justice Sonia Sotomayor and Justice Elena Kagan was evidence that the Coast Guard officer was in the process of plotting an attack.

“I can’t wrap my mind around that being anything beyond targeting,” the judge said.

When investigators searched Hasson’s basement apartment in Silver Spring, Maryland, they found 15 guns, including seven rifles, and more than 1,000 rounds of ammunition.

In a 2017 letter he apparently wrote to a neo-Nazi leader, Hasson identified himself as a white nationalist for over 30 years and “advocated for ‘focused violence’ in order to establish a white homeland,” according to prosecutors. Hasson’s online history showed searches that included the phrases “how to bring down the us government,” “most liberal fed judges usa” and “how to rid the us of jews,” prosecutors said.

A defense witness, Stephen Hart is an expert in violence risk assessment. Hart testified that he examined the evidence cited by prosecutors and rejected their theory that Hasson intended to carry out an attack.

Defense lawyers dispute that their client has any “sincerely held” extremist, racist or white nationalist views. They described him as an avid firearms collector and disaster “prepper” who stockpiles survivalist gear for “doomsday-type scenarios.”

Hasson worked at Coast Guard headquarters on a program to acquire advanced new cutters for the agency. He remained on active duty pending the outcome of the criminal case.

Hasson ordered at least 4,650 tramadol pills from internet distributors and had them shipped to his homes in Maryland and Currituck, North Carolina, according to Windom. The prosecutor said Hasson consumed most of the pills, often at work.