SAN FRANCISCO — A federal judge in San Francisco Tuesday denied bail to a political consultant accused of possessing a homemade bomb in his apartment in the city.

Ryan Kelly Chamberlain II’s defense lawyer, saying that his client urgently needs mental health treatment, had asked U.S. District Judge Vincent Chhabria at a hearing Monday to grant Chamberlain release to a psychiatric facility so he could receive care.

But Chhabria wrote in a two-page order, “There is clear and convincing evidence Chamberlain would pose a danger to the community if released.”

The judge upheld a ruling in which a federal magistrate last month also denied Chamberlain bail.

Chamberlain, 42, is accused of one count of possessing an unregistered destructive device — namely, an alleged bomb found during an FBI search of Chamberlain’s Nob Hill apartment on May 31 — and one count of possessing a gun with the serial number removed.

He has been in custody since being arrested near Crissy Field in the city on June 2 after a nationwide manhunt.

Federal prosecutor Philip Kearney told Chhabria at a hearing Monday that he expects to obtain a revised grand jury indictment by the end of this month with an additional charge “based on positive tests for a
toxin.”

In a court filing last week, Kearney said the alleged toxin was abrin, a lethal substance made from the seeds of rosary pea plants. He alleged that abrin powder was found in vials hidden inside two mini-flashlights seized from Chamberlain’s apartment.

Chhabria, who will preside over Chamberlain’s not-yet-scheduled trial, scheduled a status conference in the case for Aug. 11.

Defense attorney Jodi Linker told Chhabria at Monday’s hearing that two doctors have concluded Chamberlain needs psychiatric treatment. Linker urged the judge to release Chamberlain to a hospital with safeguards including electronic monitoring, a ban on mail and a requirement that he could not leave the hospital.

But Chhabria wrote, “There is no basis for concluding that his placement in such a facility (whose security safeguards are unknown and whose power to hold patients against their will is extremely limited) would protect the community from the danger Chamberlain would pose.”

Prosecutors allege that bomb materials found in Chamberlain’s apartment included a glass jar containing batteries, pyrotechnic powder and a rocket motor; ball bearings and screws believed to be intended as shrapnel; an ignition device; and a remote-controlled receiver.