In the past year, authorities say, Oscar Ramiro Ortega-Hernandez became more and more agitated. Louder and louder, his mind warned him that the government was plotting against him. As he saw it, one man personified the threat:

President Obama.

About a month ago, Ortega-Hernandez, 21, abruptly left his home in Idaho Falls, Idaho, climbed into his 1998 Honda Accord and drove away without explanation, acquaintances there later said. One of them knew that Ortega-Hernandez owned a powerful rifle. This person “looked in Ortega-Hernandez’s room for the gun,” a federal agent wrote in a court affidavit. “And the gun was not there.”

Last Friday night, law enforcement officials allege, Ortega-Hernandez stopped his black four-door Honda near 17th Street and Constitution Avenue NW, about 750 yards from the south face of the White House.

He had traveled 2,200 miles.

In the car, they say, he had a loaded Romanian-made Cugir SA semiautomatic rifle equipped with telescopic sight, three spare magazines filled with 7.62x39mm ammunition, and several boxes of bullets, along with brass knuckles and an aluminum baseball bat.

What possessed him? The acquaintances later reported that Ortega-Hernandez had told them that he “needed to kill” the president, that Obama was “the devil” and “the anti-Christ” and that he “will not stop until it’s done.” Just past 9 p.m., authorities say, he aimed the rifle out of a window of his car, toward the White House.

And he allegedly squeezed the trigger again and again. Some of the rounds struck the exterior of the residential area of the mansion, according to the affidavit, which was made public Thursday. Investigators would later find nine spent shell casings in Ortega-Hernandez’s abandoned sedan.

An official, speaking on the condition of anonymity because the attack is under investigation, said authorities have found no evidence of anyone else being involved in the shooting. Ortega-Hernandez has not been linked to any radical organizations or co-conspirators, the official said.

It’s unclear whether any of Ortega-Hernandez’s acquaintances warned authorities about him before last Friday — whether they told police about the alleged threats toward Obama, about Ortega-Hernandez’s sudden departure from Idaho or about the rifle.

Arrested Wednesday in western Pennsylvania after a five-day manhunt, Ortega-Hernandez was charged with attempting to assassinate Obama, punishable by up to life in prison. A federal magistrate in Pittsburgh ordered him jailed Thursday pending a yet-to-be-scheduled appearance in U.S. District Court in Washington, where he will be prosecuted.

The president and first lady Michelle Obama were in San Diego at the time of the shooting. As for the couple’s two daughters and their grandmother, a spokeswoman for the first lady would not say where they were that night. She referred questions to the Secret Service, which declined to comment on the family.

No one was injured in the shooting.

On Tuesday, four days after the gunfire, the Secret Service said it found a bullet hole in a window on the south side of the White House. The slug had pierced the “historic exterior glass” but was stopped by ballistic glass behind it, the Secret Service said.