A suspect has been arrested for allegedly shooting a Philadelphia police officer during an altercation in West Philadelphia Sunday night, police said Monday.

Scott Griffin, 23, was taken into custody Monday afternoon after undercover officers apprehended him on North Alden Street in West Philly.

“A dangerous man is off the streets,” Police Commissioner Richard Ross said during a press conference.

Griffin reportedly had more than a dozen prior arrests and allegedly had a gun on him when police caught up with him Monday. Investigators were running ballistics tests to determine if it was the same weapon used in Sunday’s shooting.

RELATED: New details in case of man charged in 4-year-old daughter's shooting

The officer wounded, Officer James McCollough, 24, encountered Griffin Sunday night while patrolling West Philly’s police 18th district, according to police. It was just before 9 p.m. when a woman flagged down McCollough at the corner of Salford and Market streets, claiming she had just been carjacked by two men. That’s when the officer got into a scuffle with the suspect, who then fled, and McCollough gave chase.

Police said that during the pursuit, Griffin allegedly turned and opened fire, and McCollough was hit once in the left thigh. He was taken to Penn Presbyterian Medical Center, where he was treated for his injury and spent the night. He was released Monday afternoon.

Two others suspects were taken into custody Monday as well. Their names have not been released.