FLAGSTAFF, Ariz. – Investigators with the Flagstaff Police Department said they had the suspect in Wednesday night’s shooting outside the Coconino County Jail under arrest by Thursday afternoon.

Officers said 38-year-old David Scrum confessed to his involvement in the shooting and was arrested in the hospital.

Thursday morning, Sgt. Cory Runge with the FPD said the suspect’s motive was unknown.

“They could’ve been looking for retaliation against police. That’s one of the things that we’re looking at. He could’ve had some kind of contact with the individual who was being released, we’re unaware of that. Additionally, there could be any kind of health factors involved or some kind of terrorism-type plot, we just don’t know,” Runge said.

Scrum was caught on surveillance video wandering around the jail and police department lobbies Wednesday just after 10 p.m., at one point even asking for an officer so he could report a crime.

“When dispatch answered he had already left,” Runge said.

About an hour later, police said Scrum was back on the property, just as his unsuspecting victim was heading out. The suspect asked the man leaving the jail whether he was an employee there.

“He denied being an employee and the subject shot him and took his belongings,” Sgt. Runge said.

“As the bullet passed through the victim’s body it had entered this building. If you look at the back of this building, you’ll see the glass on the side of the wall,” Runge said, pointing at the shattered glass.

The entire thing was caught on security video. Thursday police released photos of the suspect on social media, which led to a tip and a name.

Scrum was found in the hospital, where he was arrested for second-degree attempted homicide and then booked into jail.

Police said the victim was in stable condition Thursday and recovering from his wounds in the hospital.