A federal judge in Maryland Monday ordered a Coast Guard lieutenant accused of targeting prominent Democratic politicians and media personalities to be held until his trial on drug and gun charges.

U.S. Magistrate Charles Day had ruled last month that the charges against 50-year-old Christopher Hasson did not warrant keeping him in custody. Day ruled last week that Hasson could be released from custody and supervised by relatives in Virginia, but gave federal prosecutors time to appeal the order.

On Monday, U.S. District Judge George Hazel revoked Day's order and canceled a scheduled hearing on the conditions of Hasson's release.

Hasson was arrested Feb. 15 outside Coast Guard headquarters in Washington, where he worked on a program to acquire advanced new cutters for the agency. Prosecutors claimed he compiled a computer spreadsheet hit list that included Democratic presidential hopefuls Sens. Kirsten Gillibrand, Elizabeth Warren, Cory Booker and Kamala Harris. Also mentioned were MSNBC's Chris Hayes and Joe Scarborough and CNN's Chris Cuomo and Van Jones.

Prosecutors described Hasson in court documents as a "domestic terrorist" who "intends to murder innocent civilians on a scale rarely seen in this country," but have not filed any terrorism-related charges against him. They also claimed Hasson self-identified "as a White Nationalist for over 30 years and advocated for 'focused violence' in order to establish a white homeland."

Hasson's attorney, Liz Oyer, told Judge Day last month that prosecutors "have not come forward with evidence that Mr. Hasson is a domestic terrorist because he is not." and claimed that the government was seeking to punish Hasson for "private thoughts" that he never shared.

But prosecutors believe Hasson "planned to turn his thoughts into action," claiming in court documents that he repeatedly studied a manifesto authored by Anders Behring Breivik, the Norwegian right-wing extremist who killed 77 people in a 2011 bomb-and-shooting rampage. Prosecutors have also said that Hasson used his work computer to search for information on subjects including the Unabomber, the Virginia Tech gunman and anti-abortion bomber Eric Rudolph. Hasson also allegedly Googled topics like "most liberal senators," "best place in dc to see congress people," and "civil war if trump impeached".

"This is a case study in the adage, 'When someone shows you who they are, believe them the first time.' Through years of research and purchases, the defendant made plain his intentions, though he kept them quiet so as not to attract attention," Assistant U.S. Attorney Thomas Windom wrote in a court filing Friday. He added that the government has no doubt that Hasson's arrest "prevented a mass casualty event." and insisted that "[h]is continued detention is imperative."

CLICK HERE TO GET THE FOX NEWS APP

Investigators found 15 guns, including seven rifles, and more than 1,000 rounds of ammunition at Hasson's basement apartment in Silver Spring, Md. He is accused of unlawful possession of firearm silencers, possession of a firearm by unlawful user or addict of a controlled substance, and illegal possession of the opioid painkiller tramadol.

Hasson, who faces up to 31 years in prison if convicted on all charges, has pleaded not guilty. A trial date has not yet been set.

Fox News' Bill Mears and The Associated Press contributed to this report.