WASHINGTON (Reuters) - A U.S. judge on Friday released a Pennsylvania doctor arrested this week with guns and ammunition at President Donald Trump’s Washington hotel who authorities say wanted to meet the president and bring down “big pharmacy.”

Bryan Moles, 43, of Edinboro, faces weapons charges after police found an assault rifle, pistol and 90 rounds of ammunition on Wednesday in his BMW at the Trump International Hotel, where he had checked in.

The former Navy corpsman’s arrest, prompted by a tip from Pennsylvania authorities to the U.S. Secret Service and Washington police, averted a “potential disaster,” the capital city’s police chief said.

U.S. Magistrate Judge Robin Meriweather on Friday said Moles could remain free from custody while the case was pending but ordered him to stay away from the White House and Trump’s hotel, as well as Washington unless in the city for something related to his case. He also must surrender the more than 20 firearms at his home, she said.

The judge ordered Moles to report for a mental health evaluation at a Veterans Affairs hospital in Georgia, where he will live with a friend. He told Meriweather he was married with two children.

Moles, who faces a federal charge of unlawful possession of a firearm and a local charge of unlawful transportation of a firearm, was released on the local charge under similar conditions.

He and his lawyer, public defender Loui Itoh, declined to comment after the hearing.

A criminal complaint said Moles had told an acquaintance in voicemails that he was heading to the White House and would stay there until he met Trump.

Moles said he “was a refugee intent on bringing down big pharmacy and big business medicine,” the filing said.

He told the acquaintance his car “looked like Timothy McVeigh or Eric Rudolph was going on a camping trip,” referring to men convicted of deadly bombings in the 1990s.

Police found $10,000 in his room, and Moles told officers he had $4.19 left in his checking account. The number was important to him because it corresponded to the date of the April 19, 1995, bombing of a federal building in Oklahoma City by McVeigh that killed 168 people, the filing said.

Moles, a physician at the University of Pittsburgh Medical Center, told Meriweather he had been suspended from his job and owed between $6,000 and $7,000 a month in debt payments.

A federal preliminary hearing is scheduled for June 22.