A SEPTA transit police officer was hospitalized in critical but stable condition after a gun battle erupted Wednesday evening between police and a man suspected of shooting two women in the city’s Frankford section.

The male suspect was later found dead inside an apartment building where he had barricaded himself and was firing out a window at officers, police said after the situation was declared under control. Police said he appeared to have a self-inflicted gunshot wound.

» READ MORE: Update: SEPTA police officer and two civilians shot in Frankford shootout; gunman found dead

Around 7 p.m., officers responded to the sound of gunshots near the Arrott Transportation Center and found two women with gunshot wounds at Arrott and Griscom Streets, police said.

A man believed to be the shooting suspect ran into a property on the 4700 block of Leiper Street and began firing shots from a window at officers outside, police said.

Multiple officers fired back at the shooter, police said.

The wounded SEPTA transit police officer — who is 28 years old and has been with the force for three years — was transported to Temple University Hospital.

Several officers were pinned down but were rescued with the help of a SWAT armored vehicle.

In cell phone video taken by a nearby resident and shown to The Inquirer, officers can be seen taking cover on the corner of Leiper and Arrott Streets as the gunman fires down on them from the second-floor window of the corner property.

One officer, wearing a tactical vest, appears to take a shot in the chest area.

”I’m shot!” he appears to yell in the video, falling to the street behind a police cruiser.

The officer pulls himself up and staggers west on Arrott Street, away from the house, as other officers exchange gunfire with the shooter.

Around 8:25 p.m. the situation was declared under control. Police later said the man was found dead inside the property with an apparent self-inflicted gunshot wound. A gun was found near his body, police said.

SEPTA Transit Police Chief Thomas J. Nestel III told the media at the Temple hospital that the officer was expected to recover.

“I’m just happy he’s going to be OK,” Nestel said.

Joining Nestel for his briefing were city Police Commissioner Danielle Outlaw and state Attorney General Josh Shapiro. Mayor Jim Kenney also visited the hospital.

Outside Temple, the injured officer appeared on a cell phone video chat from his hospital bed, prompting cheers from fellow officers.

The two injured women, ages 42 and 57, were reported in stable condition.

“Here we are again … another night in our city — just this completely and totally unacceptable and reckless gun violence nearly took three innocent peoples’ lives, and we’re so grateful it wasn’t worse,” said Sgt. Eric Gripp, spokesperson for the Philadelphia Police Department.

Gripp compared the situation to the dramatic standoff in 2019 that led to six city officers being shot in North Philadelphia.

The area around the barricade was closed to civilian traffic.

Dozens of police officers were working to cordon off a multiblock stretch near Arrott Transportation Center shortly after 8:30, where dozens of bullet casings could be seen on the ground near Penn and Arrott Streets.

One resident near the scene, who asked not to use his name, said he was in his house eating dinner when he heard 30 to 40 shots outside on Arrott Street.

His daughter was getting off the train when gunfire erupted, he said. “One of the bullets barely missed her.”

This particular block had not seen many shootings recently, he said.

This is a developing story and will be updated.