A Virginia man was arrested after law enforcement found at least one firearm and ammunition in his truck as he tried to enter an inauguration security checkpoint near the Capitol on Friday evening with a credential that was not authorized, according to court documents.

Wesley Allen Beeler, 31, of Front Royal drove his Ford F-150 up to a checkpoint on E Street, northeast of the Capitol, where he was met by Capitol Police officers, according to the court documents. The area is one of many under complete lockdown following the Jan. 6 breach of the Capitol and ahead of the Jan. 20 inauguration.

Beeler was arrested on charges of carrying a pistol without a license, possession of an unregistered firearm and possession of unregistered ammunition, a Capitol Police spokesperson said. At a hearing on Saturday afternoon, the U.S. attorney’s office for the District asked a judge to issue a stay-away order. Beeler was released on personal recognizance, which prosecutors did not object to, even when the judge asked three times whether the government wished him to be held ahead of trial.

D.C. police chief Robert J. Contee III spoke on Jan. 13 about the security teams and safety plans being put in place for the presidential inauguration in D.C. (Mayor Muriel Bowser)

“It was an honest mistake,” Beeler explained after being released. In a tear-filled interview, he said he has spent the past week working as hired security in downtown Washington ahead of the inauguration. He said he forgot that his firearm was in his truck when he left his home in Virginia, where he said he has a license to carry. He said he realized it was there halfway through his trip but that he was running late, so he didn’t turn around. He denied that he had the more than 500 rounds of ammunition listed in his arrest report.

“I pulled up to a checkpoint after getting lost in D.C. because I’m a country boy,” he said. “I showed them the inauguration badge that was given to me.”

A person with knowledge of Beeler’s actions, who spoke on the condition of anonymity because the case is pending, said Beeler has no extremist ties, cooperated fully with law enforcement and was cleared from further investigation, except for the charge of violating District law by carrying a pistol without a license.

Beeler said he was given a credential by his employer, MVP Protective Services. A man who answered a phone number connected with MVP said, “Unfortunately, at this time I am not authorized to speak,” when reached by a reporter Saturday evening.

U.S. Capitol Police said in charging papers that Beeler was “not authorized to enter the restricted area” with the credential he presented.

In a statement Saturday, police said he presented “a non-government issued” credential.

As his credential was being checked, another officer noted bumper stickers on the truck that read, “Assault Life” and “If they come for your guns give ’em your bullets first,” police said.

The officers asked Beeler whether he had weapons in the car, and he volunteered that he had a Glock in his center armrest, charging papers said.

After removing Beeler from the truck, officers found that the firearm, a 9mm handgun, was loaded with a high-capacity magazine and 17 rounds of ammunition and that the pistol was chambered and ready to fire, court document said.

Police said they also found more than 500 rounds of pistol ammunition, including hollow-point bullets. Nearly two dozen shotgun shells were “located in plain sight in the rear cargo area of the vehicle,” the court documents said.

Beeler said he recalls having only the loaded firearm and the shotgun shells in his vehicle.

“It was just me forgetting to take it out of my truck before I left for work. I don’t know what the D.C. laws are. It still comes back on me, but I’m not a criminal,” he said.

Beeler said he volunteered for a job in D.C. after a friend let him know of an overnight job with MVP to guard media equipment located at Seventh Street and Constitution Avenue NW. He said the credential he was given had previously been enough to enter that area.

He said he has had numerous security assignments in the past, including working as a corrections officer and providing security for a Saudi Embassy property. A spokeswoman for Allied Universal Security Services confirmed that Beeler had previously worked for U.S. Security Associates, a smaller security company it acquired.

Prosecutors did not talk about the details of the case at the hearing, and a spokesperson for the office did not respond to a request for comment Saturday night.

Beeler’s mother and father, who both spoke to The Washington Post before Beeler was released from custody, said he works in private security and had been reporting for work downtown through the past week.

Beeler’s wife, Noelle Beeler, said she realizes why people reacted with fear and concern at the report of a man with a Glock and a cache of ammo in his truck in downtown Washington.

“It’s understandable during these times. It does sound suspicious,” she said. The couple was trying to find a way for Beeler to return home after his release and to explain to their children what happened.

“I don’t want my kids to think I’m a bad person,” Beeler said.

Beeler has been ordered not to return to the city except to appear in court or meet with his lawyer.

Julie Tate, Jennifer Jenkins, Peter Hermann, Alex Horton, and Dan Lamothe contributed to this report.