By CBS3 Staff

PHILADELPHIA (CBS) — It was a chaotic scene Wednesday night during an officer-involved shooting in Logan. A 24-year-old man was killed and an officer was injured when a confrontation broke out during a traffic stop on West Somerville Avenue near 15th Street.

Police have identified the 24-year-old man as James Alexander.

READ MORE: Seven Years After Her Disappearance, Still No Traces Of What Happened To Amanda DeGuio

Police released their initial summary of Wednesday night’s shooting, claiming officers were defending themselves.

It all began as a traffic stop and ended with 30 rounds fired.

“I’m just glad it didn’t extend further than what it did,” Philadelphia Police Commissioner Danielle Outlaw said. “There’s a process involved. We’ll continue to gather facts and my expectation is that we’ll continue to do what we’re trained to do within policy and our officers will continue to do just that.”

Just after 6:45 p.m., police say officers in full uniform and operating a marked patrol car, pulled over a blue Kia Optima for failing to stop at a stop sign. Once the officers gathered information from the four people occupying the vehicle, they learned the driver of the Kia had an outstanding warrant for parole/probation violations, and Alexander, who was sitting in the rear passenger side of the car, had an outstanding warrant for bail jumping in Wisconsin.

“We go out to protect the community and we don’t know what we’re walking into,” FOP President John McNesby said.

The two officers then called for backup, as four additional officers arrived at the scene.

All of the officers approached the blue Kia in order to remove the driver and Alexander. Two officers approached the driver’s door and requested him to exit the Kia, to which he complied.

Another two officers opened the rear passenger door and asked Alexander to exit the vehicle, according to police. One of the officers told him to leave his phone in the car and asked if he had a gun on him.

Alexander then removed a firearm from the front of his waistline, police say, and the officer screamed, “he’s got a gun.”

READ MORE: Philadelphia Health Commissioner Dr. Thomas Farley Resigns Over Mishandling Of Remains Belonging To Victims Of 1985 MOVE Bombing

While still positioned in the vehicle, police say Alexander discharged his weapon in the direction of police who positioned themselves on the passenger side of the Kia.

Police say he then exited the Kia and discharged at least two additional rounds in the direction of the police officers.

According to police, three of the officers fired back. One of them, who was responding as backup, was shot in the foot. The officer has since been discharged from the hospital.

“We’re glad he’s OK. We’re glad all the officers are OK,” McNesby said.

Alexander was struck and was transported to Einstein Hospital by police where he was pronounced dead.

Investigators spoke with the other passengers in the vehicle and their statements are reportedly consistent, stating that Alexander told them he had a gun and “could not go back to jail.”

Another witness reportedly told police that he observed Alexander on the sidewalk facing away from officers and extend his arm in the opposite direction while discharging at police. But upon reviewing the officers’ body camera footage, Alexander’s firearm was seen pointing in the direction of police and a cloud of smoke was observed from his firearm as he was still seated in the Kia, according to authorities.

Police say a second cloud of smoke was observed as Alexander was on the sidewalk, facing away from officers, but he extends his arm to the side and slightly backward.

“Utilizing deadly force is one of the most difficult decisions that an officer will ever face,” Outlaw said. “These actions have long-lasting effects on everyone, not just those directly involved in these incidents. I want to assure the public that a thorough and complete investigation will be conducted into this police-involved shooting.”

MORE NEWS: 2 Young Unresponsive Children Rushed To Hospital After Mother Jumps Out Window, Philadelphia Police Say

CBS3’s Alecia Reid contributed to this report.