Bryan Moles, left, after his release Thursday outside D.C. Superior Court pending a federal-court appearance set for Friday. His attorney, Eugene Ohm, right, is with the D.C. Public Defender Service. (Keith Alexander/The Washington Post)

A Pennsylvania man arrested at Trump International Hotel in downtown Washington after a military-style rifle was found in his vehicle was ordered by a federal magistrate to undergo mental health treatment at a veterans hospital in Georgia, pending a trial on firearms charges.

Bryan Moles, 43, must report to the Atlanta Veterans Affairs Medical Center by 4 p.m. Monday after he told police that he had traveled to the District — with an AR-15 rifle, a handgun and more than 90 rounds of ammunition in his 2017 black BMW — to meet with President Trump.

In charging papers, prosecutors said Moles said he came to Washington to “bring down big medicine business and big pharmacy” and did not plan to leave 1600 Pennsylvania Ave. until he saw the president.

Moles is a licensed physician and former Navy corpsman. He told police, charging documents state, that he suffers from post-traumatic stress disorder, had refused medication and was treating himself with marijuana, to which he was formerly addicted.

He was ordered Friday to remain under court supervision while living with an Atlanta friend, keep out of the District except for court appearances, stay away from the White House and Trump hotel, and surrender 20 weapons he kept at his home in Edinboro, about 100 miles north of Pittsburgh.

A friend of Moles’s for 25 years — Lisa Della Ratta, 44, a nurse in Gulf Breeze, Fla. — has described him as a hardcore Trump supporter who grew up with weapons and might have been unaware of the District’s strict gun laws.

Moles said little in court Friday. U.S. Magistrate Judge Robin M. Meriweather assigned him a federal defender and set his next hearing for June 21. Moles told the court he was suspended from his hospital job and that his financial profile includes a house with $200,000 in equity but also more than $6,000 a month in student, home and car loans.

Assistant U.S. Attorney Michael Friedman agreed that the terms of his conditional release were enough to protect the public.

D.C. police already were searching for Moles by the time he arrived at the Trump hotel early Wednesday and told a parking valet to secure his BMW because he had weapons inside, according to the criminal complaint.

Pennsylvania State Police had relayed information they had received about a voice mail they said Moles left Tuesday with an acquaintance.

In the voice-mail message, Moles said he stockpiled his car with so much survival gear that it “looked like Timothy Mc­Veigh or Eric Rudolph was going on a camping trip,” prosecutors allege, referring to one of the 1995 Oklahoma City federal building bombers and the serial bomber who attacked the 1996 Summer Olympics in Atlanta.

D.C. detectives went to the Trump hotel about 1:50 a.m. Wednesday and saw a rifle case in the car in plain view and opened the door using a keyless entry system that the valet had been given. Inside, police found the rifle, two 30-round high-capacity magazines and a loaded Glock 23 inside the unlocked glove box.

While D.C. police and Secret Service agents said they did not have enough evidence to charge Moles with making threats and that he did not appear to pose a threat to any individuals under Secret Service protection, prosecutors noted his alleged crimes were “committed under concerning circumstances.”

According to the criminal complaint, Moles told detectives that before his road trip, he had withdrawn $10,000 “to live the life he always wanted before it was too late.”

He said that he left $4.19 in his checking account because the digits were significant to him and that he had once written a term paper on Mc­Veigh, who killed 168 people in the April 19, 1995, bombing of the Alfred P. Murrah Federal Building.

Moles agreed to speak with D.C. police and told investigators that he brought the AR-15 to the District to have a friend customize it for his son’s use back home, according to the complaint.

The complaint says he told police that he was a recovering alcoholic who has been sober since 2013 and that he suffered from PTSD and medicated with marijuana instead of prescription drugs, because the medications made him suicidal.

Moles enlisted in the Navy in 1992 and served until August 1996 as a hospital corpsman at Camp Lejeune, N.C., Navy records show.

Moles faces a federal felony charge of unlawful possession of a firearm by a user of a controlled substance.

In a court filing, police said that when they spoke with Moles at his room at the Trump hotel, officers smelled marijuana and stated that Moles told them he had marijuana and a vaporizer with him, which police recovered.

Moles also faces a District charge of unlawful transport of a loaded firearm in an unlocked passenger compartment of a vehicle, punishable by up to a year in prison.

Prosecutors had wanted to bring Moles to federal court Thursday, but he appeared instead in D.C. Superior Court.

The switch in court venue was required after prosecutors failed to notify the federal court of their intent to have Moles appear before a 1 p.m. deadline. The notification is required to enable U.S. marshals to arrange the transport of defendants to the courthouse, in Moles’s case from his cell at D.C. Superior Court, said Jelahn Stewart, a spokeswoman for the U.S. attorney’s office for the District.

Defendants typically have a right to an initial hearing within 48 hours of arrest, and Moles was arrested early Wednesday. When the federal court is not available within 48 hours, such as in Moles’s situation, defendants in the District are taken to Superior Court.

Assistant Public Defender Eugene Ohm argued at the Thursday hearing that his client committed no crime other than not knowing the District’s gun laws. He said visitors come to the District not knowing the gun laws “about three or four times a week.”

Moles was released from Superior Court on Thursday to spend the night at a hotel under court supervision until his Friday federal-court appearance, under an agreement reached by prosecutors and Ohm.

Keith L. Alexander and Peter Hermann contributed to this report.