WASHINGTON — The Secret Service arrested an Iowa man outside the White House on Wednesday who had a hunting rifle and ammunition in his car, according to law enforcement officials.

The man, Renae Kapheim, 41, of Davenport, approached uniformed Secret Service officers on foot at 15th and E Streets, a block from the White House, at 12:54 p.m., according to the officials.

“He said that someone had told him that he should come to the White House, so he had driven to Washington to do so,” said a senior law enforcement official. “The officers interviewed him there and realized that there needed to be further investigating because something wasn’t right.”

Mr. Kapheim consented to a search of his car, and in the course of that search, the officers found a hunting rifle in his trunk and the ammunition.