WASHINGTON — A man arrested near the White House on Sunday morning is a former Memphis police officer who had an arsenal of weapons in his car and believed the CIA had implanted a chip in his head, according to court documents.

Timothy J. Bates, 37, of Collierville, Tenn., appeared in a District of Columbia court Monday morning on charges of illegally carrying a rifle or shotgun.

According to court documents, Bates was approached by uniformed members of the Secret Service on Sunday at the corner of 17th Street NW and Pennsylvania Avenue as he appeared to be publicly urinating. He told the officers he was trying to reach Defense Secretary James Mattis or NSA Director Mike Rogers “for advice on missing paychecks and how to get the dog chip out of my head.”

Bates gave officers permission to search his illegally parked car and they discovered nine firearms, including a Bushmaster assault rifle and a loaded AK-47.

According to testimony by the arresting officers detailed in the court documents, Bates told the Secret Service officers that he had been offered $28.7 million by the Department of Homeland Security and the state of Tennessee to participate in the CIA’s “MK Ultra” program and that he had a chip planted in his head that was causing him “severe headaches, shaking and convulsions.”

Bates told the officers that he had driven from Tennessee to seek advice from Mattis and Rogers on how to remove the chip and recover the promised payment.

The court documents state that Bates is a former police officer who was “medically retired” in 2013 and that he was “involuntarily committed for mental health reasons” in February 2017.

It was not immediately clear if Bates had his own defense attorney.

The charge of illegally carrying a rifle is a felony with a statutory maximum of five years in prison and a fine of up to $5,000. The court documents state that Bates had been placed under observation for mental illness.