Several of the firearms were loaded and some were described as assault-style weapons, including an AR-15 and an AK-47, according to authorities.

A spokesman for the Memphis Police Department said the suspect, Timothy J. Bates, 37, of Collierville, Tenn., had been an officer there for 13 years before leaving in 2013. Court records show he was allowed to retire early because of medical issues.

A D.C. Superior Court judge on Monday ordered Bates detained until a preliminary hearing on Thursday. An arrest affidavit says Bates was committed for mental health issues in February.

Bates is charged with several firearms offenses. His relatives could not be reached. His attorney, Lisbeth Sapirstein, declined to comment.

Authorities said uniformed U.S. Secret Service officers stopped Bates about 7:15 a.m. on Sunday near 17th Street and Pennsylvania Avenue NW after it appeared he was about to urinate in public.

Bates told the officer that he drove through the night from Tennessee and “came to the White House in order to speak with Adm. Mike Rogers and Gen. Jim Mattis for advice on missing paychecks and how to get the dog chip out of my head,” according to the affidavit. Navy Adm. Michael S. Rogers is director of the National Security Agency; Mattis is the secretary of defense.