Authorities today identified a man who was fatally shot by a Signal Hill police officer when he allegedly attacked the officer with a knife a short time after authorities say he stabbed a man at a grocery store.

Phillip Lopez, 42, who was homeless, died at a hospital following the shooting, which occurred about 1 p.m. Monday near the store in the 1600 block of East Willow Street, according to the Los Angeles County coroner’s office and the Los Angeles County Sheriff’s Department.

Signal Hill officers had gone to the area on a report of a stabbing at the store, sheriff’s Deputy Tracy Koerner said.

“As officers responded, they received information that the suspect was fleeing from the location on foot, westbound on Willow Street,” Koerner said in a statement. “During the police response, an officer located an individual walking westbound on the north curb of Willow Street, matching the description of the suspect from the earlier stabbing.

“As the officer attempted to detain the suspect, the suspect ignored his commands and continued to flee,” Koerner said. “The officer then exited his vehicle, again attempting to detain the suspect. The suspect produced a large knife and attacked the officer, at which time an officer-involved shooting occurred.”

Lopez was wounded at least once in the upper body, Koerner said. The officer was not injured. A large knife was recovered at the scene, Koerner said.

The man who was stabbed at the grocery store was taken to a hospitalin fair condition, Koerner said.

Sheriff’s homicide detectives were assisting the Signal Hill PoliceDepartment in the investigation.

UPDATE: Stabbing suspect shot, killed by Signal Hill police