Philadelphia police are investigating the fatal shooting of a man who they say shot into a crowd in Kensington, then turned his gun on two undercover officers.

According to the department, officers Michael Suarez and Henry Lesesane, both in plainclothes and members of the Narcotics Field Unit, opened fire, killing Carlos Rodriguez after he shot into a crowd of people who were fighting on the corner of Water and Clearfield Streets at about 6:30 p.m. last Thursday and then shot into the air.

Rodriguez, 40, was pronounced dead at an area hospital shortly after the shooting. His weapon was recovered from the sidewalk next to his body, police said.

Suarez, 27, a four-year department veteran, and Lesesane, 23, also a four-year veteran, were not injured. A woman at the scene initially told officers she had been struck by gunfire, but a medical examination at Temple University Hospital determined that was not so, police said.

Police Commissioner Danielle Outlaw said the shooting underscores the danger officers face each day.

“This latest police-involved shooting proves once again that dangerous situations can, and do, arise at a moment’s notice,” Outlaw said.

“Our officers are trained to use deadly force when there is an objective and reasonable belief that there is an immediate threat of death or serious bodily injury,” she added. “As with all officer-involved shootings, these officers have been placed on administrative duty pending a full review of the incident and the outcome of the Internal Affairs investigation.”

The department said the officers were on patrol and driving in an unmarked vehicle traveling north on the 3000 block of North Water Street when they saw a large crowd fighting near the southeast corner of Water and Clearfield.

When the officers stopped their car at the corner, people began striking it, and the officers saw the man, later identified as Rodriguez, fire a gun into the crowd and also in the air, the department said.

When the officers got out of their car and identified themselves as police, authorities said, Rodriguez pointed his gun at Suarez and both officers fired their weapons, killing him.