Long Beach police said a man was shot when he got into a struggle with a gunman who’d just tried to rob him Wednesday night.

The man was walking in the 2700 block of Bellflower Boulevard, which is just north of Willow Street, when the gunman approached at around 10 p.m., according to the Long Beach Police Department.

“A struggle for the firearm ensued between the suspect and victim when the firearm discharged, striking the victim in the upper body,” the LBPD said in a statement.

The victim went to a hospital himself where police interviewed him, according to the LBPD.

The gunman fled before officers arrived, and police are still trying to gather information on a suspect.