PHILADELPHIA -- The man accused of opening fire on a Philadelphia police officer and shooting him three times late Thursday has admitted he did it in the name of Islam, according to a report by CBS3 that cites law enforcement sources.

The suspect, whose condition has yet to be released, was captured by authorities following the 11:30 p.m. shooting near 60th and Spruce streets, in West Philadelphia.

"After standing out on that crime scene. After seeing the sea of spent shell casings and the steaming bullet holes hammered into your car door. After watching the surveillance video and replaying the scenario over and over again in my head, you definitely shouldn't be here right now. It should have been 100 times worse," Philadelphia police officer Jonny Castro, who responded to the scene, wrote on Facebook Friday morning.

A photo posted by Castro appears to show blood on the inside of Hartnett's police cruiser and on the street underneath the driver's side door.

"Not many people would have survived an ambush like that. He got the drop on you and had every intention of killing a cop. Whether it was your training, his lack of training, some divine intervention or a combination of all 3; it simply wasn't your time," Castro continued.

On his Facebook page, Hartnett writes that he's a native of East Lansdowne, Pennsylvania, and served with the U.S. Coast Guard for more than a decade. Hartnett's LinkedIn profile page indicates that he's a four-year veteran of the force and attended Delaware County Community College.

Greg Adomaitis may be reached at gadomaitis@njadvancemedia.com. Follow him on Twitter @GregAdomaitis. Find the South Jersey Times on Facebook.