PHILADELPHIA (CNN)–The Pennsylvania man who is accused of bringing high-powered weapons and ammunition to Donald Trump’s Washington hotel and wanting to get close to the President is out of jail.

Late Thursday, a D.C. Superior Court judge temporarily agreed to release Bryan Moles, 43 — after a last-minute deal between the federal prosecutor and defense attorney.

Last-minute negotiations

The judge had recessed in order to read up on the case and the federal statutes, which Assistant US Attorney Michael Friedman had initially argued should be used to keep Moles behind bars.

When the recess ended, Friedman told the judge that he and Moles’ attorney, Eugene Ohm, had brokered a deal which allowed Moles to walk out a free man, at least temporarily.

The conditions of the deal include: Moles relinquish his cache of weapons at his Pennsylvania home pending the end of this case; Moles must not have access to any weapons or have anyone assist him in getting access to any weapons; Moles must stay away from the White House, the Trump International Hotel, and its surrounding areas; and Moles must stay in Washington at an undisclosed hotel, which is guarded by US marshals, until his federal court hearing on Friday afternoon.

Man Arrested At DC Trump Hotel Had 2 Guns, Was A Doctor From Pennsylvania

Upon hearing about the agreement, the judge said: “There would’ve been a basis to hold him.”

But after the government attorney changed his request, the judge said he couldn’t go against that agreement.

Therefore, he told Moles, “I’m going to release you. I didn’t think I’d arrive at this point, given my concerns.”

Background

The father of two is facing federal weapons charges, including unlawful possession and unlawful transport of a firearm, after local police found him at the Trump International Hotel on Wednesday.

The charging document said that Moles left voice mails with an “acquaintance” before arriving in D.C. and said he was heading to 1600 Pennsylvania Avenue and would stay until he met with Trump.

He also allegedly mentioned in the voice mails that his car was filled with ammo, cellphones and survival supplies and that his car looked like “Timothy McVeigh or Eric Rudolph was going on a camping trip.” (McVeigh was convicted and executed for the Oklahoma City Bombing in 1994. Rudolph was the so-called “Olympic Park Bomber” who was also involved in anti-abortion and anti-gay attacks).

The person who received Moles’ voice mails later called police and alerted them of Moles’ alleged plans.

Moles eventually decided to check into the Trump International Hotel, and when he did, the criminal complaint states he asked the parking attendant to keep his car “secure” because it contained two firearms.

Trump Withdraws US From Paris Climate Accord

The hotel called D.C. police, who came to Moles’ room. When they arrived, the charging documents state that the father of two told officers he had loaded firearm magazines in his room. He also explained that he was a recovering alcoholic, was previously addicted to marijuana and has post-traumatic stress disorder related to his years in the Navy, the complaint states.

Police would later find an AR-15 style assault rifle, a Glock handgun and 90 rounds of ammunition in his car.

In the courtroom

Before the recess and the last-minute negotiation, Friedman argued that Moles was a flight risk and said, “Releasing him now would result in grave danger to the community.”

Moles’ attorney countered that his client did not know D.C.’s gun laws and didn’t pose a flight risk.

In court, Moles said very little, only using one- or two-word answers, when the judge asked him direct questions.

But, when asked whether he had talked to his wife or family, Moles said, “I haven’t talked to anybody in two days.”

Outside the courthouse, as he quickly walked with his attorney to a nearby car, Moles made no comments about the case to reporters.

When asked whether he had any messages for his family, he said: “I love them. I’ll be calling them soon.”

The-CNN-Wire ™ & © 2017 Cable News Network, Inc., a Time Warner Company. All rights reserved.