Trump International Hotel
A Washington D.C. Superior Court judge temporarily agreed to release Bryan Moles, the Pennsylvania man who was accused of bringing high-powered weapons and ammunition to President Donald Trump's Washington hotel, June 1, 2017. In this photo, the Trump International Hotel in Washington, D.C., April 27, 2017. Getty Images

A Washington D.C. superior court judge temporarily agreed Thursday to release Bryan Moles, 43, the Pennsylvania man who was arrested for bringing high-powered weapons and ammunitions, including an assault rifle, a Glock and a Carbin 15 Bushmaster to President Donald Trump’s International Hotel in Washington D.C. and wanted to meet the president, according to authorities.

The judge came to the decision after a last minute agreement between the federal prosecutor and Moles’ defense attorney.

Read: Donald Trump’s Luxury Hotel Opens In Washington DC Ahead Of Presidential Elections

According to CNN, the conditions of the deal between the defense and the federal prosecutor 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 U.S. marshals,” following which his federal hearing is expected to take place Friday afternoon.

The judge said that he wouldn’t go against the agreement and told Moles: “I'm going to release you. I didn't think I'd arrive at this point, given my concerns.”

A tip was provided to Pennsylvania State Police, who then alerted the D.C. police and Secret Service that a man was headed towards Trump’s hotel in D.C. with weapons. After Moles checked into the hotel, authorities searched his vehicle and found the weapons and ammunitions. It was not clear why Moles was carrying weapons and checked into the Trump property. The D.C. Police Chief Peter Newsham, said in a news conference on Wednesday that he was arrested without incident or the usage of force.

“We will do a thorough investigation if we can get to the motive as to why this guy was coming to the District of Columbia… I was very concerned by this circumstance,” Newsham said.

Moles was charged with unlawful possession and transportation of a firearm. According to NBC Washington News, he was also not licensed to carry a gun in the District of Columbia.

An old friend of Moles, Lisa DellaRatta, a nurse practitioner in Florida said that she knew him for 25 years and “there is absolutely no way” he was planning anything violent. She added that Moles “cannot be a more standup man.”

Moles was said to have been recovering from alcohol and marijuana addiction and also has struggled with post-traumatic stress disorder. Moles has also served in the U.S. Navy from 1992 to 2006. For the last nine years of his service, Moles had been a hospital corpsman and was in the reserves in Erie, Pennsylvania.

Read: Does Trump Need To Give Up Washington Hotel? Controversy Brewing Ahead Of Inauguration

Moles was also said to have been practicing medicine, Pennsylvania records showed that he had renewed his license in October 2016. Moles had also worked at the Saint Vincent Hospital in Erie, Pennsylvania, until late 2013, according to Dan Laurent, a spokesman for Allegheny Health Network. According to a spokeswoman at the University of Pittsburgh Medical Center system said that he was on administrative leave there recently before his arrest on Wednesday. Moles’ hospital ID was also found in his car.

Moles' Facebook page indicated that he is a Trump supporter. Although the Secret Service said that Moles “posed no immediate threat to any Secret Service protectees,” the Trump hotel authorities did not want to take a chance and released a statement saying: “We take the safety and security of guests very seriously. It is our first priority.”

“This morning, the authorities arrested a guest who was behaving suspiciously. The matter is under investigation therefore it would be inappropriate for us to provide additional details. Please refer your inquiry to the investigating authorities,” the statement said.