It happened around 9:30 p.m. at Stanwood and Leon streets in the city's Holmesburg neighborhood.
Police say a police sergeant working in the Highway Patrol Unit was on his motorcycle when he was hit by the illegal dirt biker who ran a stop sign.
After the crash, a good Samaritan living in the area quickly intervened by helping to subdue the suspect who was trying to flee, police said.
"He got the bike started and the cop said, 'Don't let him go.' And he tried to take off, and I ripped him off the bike and pulled him down to the ground," recalled witness Anthony Wade.
The sergeant then pulled out his gun and held the suspect until additional help arrived.
According to Chief Inspector Scott Small, the sergeant suffered injuries to his leg and was taken to an area hospital in stable condition.
The dirt biker, identified as a male in his 20s, did not appear to suffer any serious injuries, police said.
Small noted that the suspect was not cooperating with police.