Philadelphia police officers fatally shot a 12-year-old boy in the back Tuesday night in South Philadelphia after a bullet was fired into their vehicle, officials said Wednesday.

The boy, identified as Thomas Siderio, was taken to Penn Presbyterian Hospital and died minutes after he was shot.

According to a police statement released Wednesday, four plainclothes officers were in an unmarked car at 18th and Barbara Streets at about 7:20 p.m. when they saw two people standing on the street corner, and one appeared to be holding a handgun.

When the driver turned on the emergency lights, police said, the officers heard gunfire and a bullet came through the back passenger-side window of the vehicle.

Police said two officers got out and fired at Thomas, who they said was holding a gun and began to flee. One of the officers chased the boy and fired twice, striking him in the upper right back area once. The bullet exited through his chest, police said.

The bullet that went through the window, police said, went through the passenger-seat headrest. One of the officers was injured in the eye by shattered glass and was hospitalized in stable condition.

Police said Thomas was carrying a semiautomatic handgun that was equipped with a laser and had been reported stolen. But Deputy Commissioner Benjamin Naish, who oversees investigations, said during a virtual briefing Wednesday that authorities can’t definitively say the boy fired the shot.

When asked why the boy was shot in the back, Naish said the fact that he was fleeing “doesn’t mean that he wasn’t continuing to be a threat to the officers.” He said they were not equipped with body-worn cameras.

The four officers in the unmarked car were assigned to a task force operating in the South Division and were conducting what police described as an ongoing gun investigation. Naish said social media posts led officers to the area of the shooting, but he could not say who made the posts.

The other person on scene, a 17-year-old who has not been identified, was briefly detained and then released.

Home surveillance footage provided to The Inquirer by residents activated in the immediate aftermath of the shooting and shows Thomas on the ground about a block east of the corner where police said they initially saw him.

Just after 7:20 p.m., an officer was recorded on the video holding his face, and asking, “Am I shot?”

Another officer responded, “No, you’re not shot.”

When a resident asked the injured officer if he wanted a wet paper towel, he replied: “I’m fine.”

A moment later, another neighbor can be heard asking police: “Could you tell me what happened? They killed him right in front of my house.”

The two officers who fired shots were placed on administrative leave pending the results of an Internal Affairs investigation. Police Commissioner Danielle Outlaw said in a statement that “a young child with a gun in their hand purposely fired a weapon at our officers and by miracle, none of the officers suffered life threatening injuries.”

“However,” she added, “the life of a young man was cut tragically short, and we should all be questioning how we as a society have failed him and so many other young people like him.”

A relative of Thomas, reached Wednesday by The Inquirer, declined to comment. Thomas was in seventh grade at George W. Sharswood Elementary School in South Philadelphia, according to a spokesperson for the School District.

Santo Primerano, 20, who knew Thomas from the neighborhood, said he was with him and the 17-year-old just before the incident took place. He said he told them he was going to work, and they said they were heading to hang out at Barry Playground.

“I didn’t even make it to Center City when I got the call,” Primerano said.

He said Thomas, who went by T.J., had a turbulent childhood but “always tried to put a smile on everybody’s face.”

“He is a good kid, always laughing, joking around,” he said.

The block on Barbara Street where the shooting took place was quiet late Wednesday morning but for the noise of children playing at the nearby Barry Playground. Two parked cars had bullet holes in them, and chalk marks where shell casings had fallen were still on the sidewalk.

Sandra Martin said she was watching Jeopardy! when she heard loud noises outside, and when she peered out, saw a boy on the ground in front of her home. She said something so violent had never happened in the five decades she’s lived on the block. She recalled small fights on the playground, but this was the first shooting she could remember.

”It’s quiet around here,” she said.

Another resident, Maureen Flocco, said she was on her couch when she heard seven or eight loud popping noises, then dropped to the floor. As the shots subsided, Flocco said she looked out and ”that’s when I seen the kid laying on the ground.” She said he had on a black coat with the hood up and was not moving.

The shock sent Flocco back inside.

”I’ll never get that kid’s face out of my head,” she said.