An Iowa man who was arrested near the White House and had a rifle in his nearby car told authorities that he had an appointment with the president, according to court papers filed Thursday.

According to charging papers, R.J. “Renae” Kapheim, 43, told a Secret Service officer that the president called him and asked that he come to the White House.

Kapheim, who had a brief appearance in D.C. Superior Court on Thursday, remains in custody on charges of illegally carrying a rifle, pending another hearing Friday.

Kapheim, who was arrested Wednesday, faces a felony offense charge that carries a maximum of five years in jail and a fine of up to $5,000, said Bill Miller, a spokesman for the U.S. Attorney’s Office in the District.

Authorities said that Kapheim approached the officer just before 1 p.m. Wednesday at a checkpoint at 15th and E streets NW, saying he drove from his Davenport home to the District for the appointment.

When the officer checked a Secret Service database and saw that there was no such appointment, Kapheim insisted that he had one, adding that he was called there by President Obama. According to charging papers, Kapheim began talking to himself and shaking his head.

At some point, Kapheim told authorities that his 2013 Volkswagen Passat was parked near Constitution Avenue and consented to a search, officials said.

Authorities found a Marlin rifle model 336A with a black scope in the car’s back seat, the charging documents say. Kapheim said he couldn’t remember whether it was loaded, authorities said.

Officers also found a six-inch knife under the driver’s seat and more than 40 rounds of various types of ammunition.

The arrest of Kapheim, who was charged with carrying a rifle or shotgun outside a home or place of business, coincided with the Secret Service’s acting director addressing lawmakers about recent security breaches at the White House.

Kapheim is scheduled to again appear in Superior Court on Friday morning, where a judge could rule on a stay-away order that would prevent Kapheim from being near the White House.

Carol Leonnig and Julie Zauzmer contributed to this report.