A police officer standing watch outside the hospital where a wounded cop is recovering was attacked for his gun Saturday night, police said.

The attack comes just days after an ambush-style cop shooting in West Philadelphia.

The police officer, who has not been identified, went to Penn Presbyterian Medical Center in West Philly around 10:42 p.m. on Saturday night to serve a detail for Officer Jesse Hartnett, who was shot multiple times Thursday night and is being treated at the hospital. 

RELATED: Donations pour in for family of Philly cop shot in 'ISIS'-related attack

According to a police report, "The officer was approached by an unknown black male later. The male stated, 'I’m hungry. I haven’t eaten in five days. Do you have any money to spare?' The officer then handed the male a five-dollar bill and then entered PPMC."

Some time later, while the officer was standing with his back to the exit of the hospital, the same male jumped at him from behind, trying to grab his gun. 

The officer struggled with the man, and with the assistance of Penn Security officers subdued him.

The man, 40, has not been identified. No formal charges were listed by police. The male reportedly said he wanted to use the gun to rob a store.

RELATED: Man who shot Philly cop claims he did it 'in the name of Islam'

"This incident was not related to the recent shooting of Officer Hartnett in any way," the police department stated in a press release on the incident. However this is an example of the type of individuals that our officers face daily when performing their duties as Philadelphia Police Officers. We are please with how this officer handled himself during this incident and the quick response by hospital security, Penn police and Philadelphia police."

See surveillance video of the incident below