Philadelphia Police Officer Fights Off Man Trying to Steal His Gun, Cops Say The officer was working detail for fellow cop wounded in shooting.

 -- A Philadelphia police officer working a detail at the hospital where a fellow officer wounded in a shooting was being treated fought off a man who tried to grab his gun, police said.

The cop was working a detail Saturday night for Officer Jesse Hartnett, who was shot Thursday by a man who walked up to his car firing repeatedly.

The officer was approached by a man as he entered the Penn Presbyterian Medical Center, according to a statement from the Philadelphia Police Department.

"I’m hungry. I haven’t eaten in five days. Do you have any money to spare?" the man asked the officer, according to police.

The cop handed him a $5 bill and then entered the hospital, police said.

When the officer came back to the entrance of the emergency room a while later, the same man approached him from behind and tried to grab the officer's gun from his holster, police said.

As soon as the officer felt the man's hand on his gun, he spun around, stopping the man from getting the gun out of the holster, according to police.

He was able to subdue the man after a brief struggle, with the help of PPMC security team members and other officers. The officer was not injured and the suspect sustained a minor facial injury, police said.

Neither the suspect nor the officer were identified in the police statement.

According to police, the suspect said he wanted the gun to use to rob a store, and there was no connection to the shooting of Hartnett, who was wounded by a man using a police handgun that had been stolen in 2013.

Hartnett was allegedly shot by Edward Archer, 30, who police say pledged allegiance to ISIS. Archer confessed to committing the shooting "in the name of Islam," Philadelphia Police Commissioner Richard Ross said during a news conference Friday. "According to him, he believed that the police defend laws that are contrary to the teachings of the Quran."

He was charged with attempted murder, aggravated assault, assault on a law enforcement officer, recklessly endangering another person, possession of an instrument of crime, violation of uniform firearms act and related offenses.