It started when a fight broke out just after 1:30 a.m. outside of The Barn, a bar located on Catharine Street near the intersection of 49th Street and Baltimore Avenue.
According to police, a group of men was beating up on a male victim.
At that time, an 18th district off-duty police officer happened to be driving his personal vehicle, a Jeep Cherokee, past the intersection with a woman in the passenger seat.
Police said he parked the Jeep outside the bar and jumped in the fray to help protect the man who was being assaulted.
"It took a lot of guts, got out of his car, approached this crowd that was actually punching and stomping a male outside of the bar, and he intervened and was able to stop the fight," Philadelphia Police Chief Inspector Scott Small said.
That's when, authorities said, one of the men drew a handgun and started firing at the off-duty officer. The off-duty officer got back into his Jeep and drove away.
"It's a little scary that guns were involved," said Jon Anderson of West Philadelphia. "Seems like it was right place, right time."
At least six shots were fired, two hitting the passenger side door where the woman was sitting.
"He was able to save this individual from getting assaulted, but, in return, somebody fired multiple shots at the off-duty officer. He's very, very lucky that he wasn't struck by gunfire," Small said.
It's still unclear if the off-duty officer ever identified himself as an officer. Police said he did have a gun on him, but never drew it.
The male victim suffered minor injuries. No one was hit by gunfire and no one was taken to the hospital.
Police said they are getting surveillance video from the bar and believe the man who fired the shots is a frequent customer. He remains on the loose.