Updated

A Department of Homeland Security analyst has been barred from the agency's headquarters while authorities continue to investigate why he allegedly brought a gun and other weapons to his workplace.

A judge barred 45-year-old Jonathan Wienke of Martinsburg, West Virginia, from the agency's Northwest Washington complex on Friday.

Wienke has been charged with carrying a pistol without a license. He has been on administrative leave since his arrest earlier this month. He was released from custody pending further court proceedings.

The case remains under investigation. A federal investigator wrote in an affidavit that Wienke was planning to commit workplace violence. Prosecutors say he brought a gun, a knife, pepper spray and handcuffs with him to work. His attorney has not returned multiple messages.