Updated

A man clad in black who was obsessed with President Barack Obama pulled his car within view of the White House at night and fired shots from an assault rifle, cracking a window of the first family's living quarters while the president was away, authorities said about their still-developing investigation.

The U.S. Secret Service found two bullets had hit the White House and agents caught up with Oscar Ramiro Ortega-Hernandez in Pennsylvania on Wednesday after a four-day search.

Police arrested the 21-year-old Idaho man at a hotel after a desk clerk recognized his picture. Ortega is scheduled to make his first appearance at 2 p.m. Thursday in federal court in Pittsburgh and many questions remained about his motive and background.

Authorities are investigating the man's mental health and say there are indications he believed attacking the White House was part of a personal mission from God, according to two different law enforcement officials who spoke with The Associated Press. There are also indications the man had become obsessed with Obama and the White House, according to the officials, who spoke on the condition of anonymity because the investigation is ongoing.

According to a Secret Service statement earlier Wednesday, law enforcement found one bullet that smashed a window at the White House before being stopped by a second layer of "ballistic glass." Another round was found outside the White House. The Secret Service said the damage "has not been conclusively connected" to the shooting.

"An assessment of the exterior of the White House is ongoing," the Secret Service said.

Fox News learned that the FBI joined the investigation on Tuesday at the request of the Secret Service and U.S. Park Police. The FBI has extensive expertise in evidence gathering, which could explain why the agency was called in to assist.

Law enforcement for days had been searching for Ortega-Hernandez. He has a record of arrests in Idaho, Utah and Texas, according to MyFoxDC.

Park Police originally obtained an arrest warrant for Ortega-Hernandez after discovering an AK-47-style rifle in an abandoned car Friday night. The car was found after Secret Service officers heard shots being fired between two vehicles about a half-mile from the White House.

U.S. Park Police spokesman Sgt. David Schlosser said Sunday that officers had obtained an arrest warrant for the suspect on a felony charge of carrying a dangerous weapon, in connection with the incident.

President Obama and First Lady Michelle Obama were in California at the time of the shooting, before traveling to Hawaii for the Asia-Pacific Economic Cooperation forum.

News of the bullets' discovery broke shortly after the president landed in Australia for a brief 27-hour visit.

Fox News' Mike Levine, The Associated Press and NewsCore contributed to this report.