A D.C. man described by authorities as a social-media supporter of the suspect in the Pittsburgh synagogue massacre was denied bail by a federal judge Friday after being arrested on gun-related charges last week.

Jeffrey R. Clark Jr., 30, who allegedly told investigators that he is a white nationalist, was arrested at his Northwest Washington home Nov. 9 after two relatives told police that he had become increasingly agitated recently, authorities said. They said they found several guns in his home, along with an array of military equipment, and said Clark had frequently posted anti-Semitic threats and other menacing statements on the Internet.

At a detention hearing Friday in U.S. District Court in Washington, his attorney, David Bos, asked Magistrate Judge G. Michael Harvey to set conditions under which Clark could be released until his trial. But Harvey declined, saying he agreed with the prosecutor in the case who described Clark as a potential danger to the community.

He is charged with possessing a firearm while using or being addicted to illegal drugs and possessing a high-capacity ammunition clip.

At Friday’s hearing, Assistant U.S. Attorney John Cummings said that in a court filing at the time of Clark’s arrest, authorities unintentionally mischaracterized his association with the Pittsburgh shooting suspect, Robert Bowers, 46, who is accused of fatally shooting 11 people Oct. 27 at Tree of Life synagogue.

A police affidavit filed in court Nov. 9 in Clark’s case suggested that Clark had detailed knowledge of the synagogue attack, based on an alleged post by Clark on the social networking site Gab. The post read, in part: “Get used to it libtards. This was a dry run for things to come.”

The affidavit said the Gab post accompanied a picture of Bowers and “implies that Jeffery Clark did know more about the attack in the Tree-of-Life synagogue, and that there was more to come.” But in court Friday, Cummings said investigators later determined that the post was not related to Bowers but to Cesar Sayoc, 56, who was arrested Oct. 26 for allegedly mailing explosive devices to critics of President Trump.

Bos, the defense attorney, told the judge that in light of that mistake, “I think the court should be very skeptical of the representations of the government” about Clark’s alleged dangerousness. But Cummings told the judge, Harvey, the mistake was an honest one.

“Did we get something wrong in our affidavit? We did,” Cummings said. “However, we diligently investigated it and corrected it.”

Within hours of the Oct. 27 Pittsburgh mass shooting, Clark’s brother, Edward Clark, 23, fatally shot himself on Roosevelt Island near Washington, authorities said.

Relatives told police that both brothers had been involved in alt-right movements. Jeffrey Clark told FBI agents that he and his brother became interested in guns in 2016 “because they believed there was going to be a civil war,” authorities said in a court filing. They said the brothers “fantasized about killing ‘Jews and blacks.’ ”

And Clark praised Bowers as a hero in some social media postings.

In addition to finding several pistols and long guns at the home, investigators said, they confiscated two ballistic vests, two ballistic helmets and two gas masks.

Calling Jeffrey Clark’s alleged Internet postings “menacing,” Harvey said “it does appear that in recent weeks, his anger has intensified.” Based on those postings, and the guns and equipment seized by police, “it seems that the defendant was preparing for something,” Harvey said.

He said, “I do not believe at this time that I can release the defendant back into the community.”