WASHINGTON — A Coast Guard officer accused of compiling a hit list of government and media figures pleaded guilty Thursday to federal gun and drug charges.

Lt. Christopher Hasson, 50, of Silver Spring, Maryland, admitted in court that he illegally bought prescription painkillers and amassed an arsenal of 15 firearms and two illegal gun silencer attachments. As a drug abuser, he was not legally entitled to possess the guns.

The FBI said he also had over 1,000 rounds of ammunition for those weapons and a briefcase full of human growth hormone vials.

When Hasson was arrested in February, prosecutors said investigators found documents at his apartment in which he described himself as having been a white nationalist for more than 30 years. Court documents said he drafted an e-mail in 2017 that said, "I am dreaming of a way to kill almost every last person on the earth."

The stockpile of guns found by investigators owned by Christopher Hasson. U.S. Attorney's Office in Maryland

Investigators also said he was a follower of Anders Behring Breivik, the far-right terrorist who killed 77 people in two coordinated attacks in Norway in 2011.

The FBI said Hasson compiled a computer spreadsheet hit list with the names of 13 members of Congress, including House Speaker Nancy Pelosi and Senate Minority Leader Chuck Schumer, and six news media figures, including Joe Scarborough of MSNBC and Chris Cuomo of CNN. MSNBC and NBC News share NBCUniversal as a parent company.

Law enforcement officials say they discovered what Hasson was up to when they were alerted to suspicious Internet searches he conducted while working as an acquisitions officer at Coast Guard headquarters in Washington. A Coast Guard official said Thursday he would remain on active duty until the criminal case was completed.

Hasson will be sentenced in January and faces up to 31 years in prison. Prosecutors said Thursday that they will argue for the maximum sentence. His public defender said a sentence of about three-and-a-half years would be more appropriate.