It happened around 7:10 p.m. in front of a home on the 600 block of Unruh Ave. near Bingham St. in the city's Lawndale section.
Investigators said someone robbed the FedEx driver at gunpoint after he delivered a package to the home.
The driver was shot in the stomach near the front entrance, but also had a gun and returned fire and shot the suspect, according to police.
The driver then drove to the nearby ACME grocery store for help where he was able to tell police what happened.
Claudia Griggs said she was heading into the store as the FedEx driver arrived.
"He pulled up real fast and got out and said something to the cop. He said he was shot," said Griggs.
The driver was transported to an area hospital where he's expected to survive, police said.
"Police did recover the firearm from the FedEx driver and he is completely cooperating with police," said Chief Inspector Scott Small of the Philadelphia Police Department.
Police were called to a third scene about a man with gunshot wounds in an alleyway along the 1400 block of Creston Street.
That 27-year-old man later died.
Police believe he's the person who robbed the FedEx driver and said they found items from the robbery on the man who died.
Investigators then found a car not far from that location in the 1500 block of Large Street with blood inside.
Police said homicide detectives took someone in for questioning who was near the car and is believed to either be involved or a possible witness, according to investigators.
The FedEx driver was licensed to carry a gun in Philadelphia at the time of the shooting.
A FedEx spokesperson released the following statement:
"The safety of our team members is of paramount importance at FedEx. As such, we do not publicly disclose details relating to our security policies. As this incident remains an ongoing police investigation, we will have no further comment."
Anyone with any information is asked to call police at 215-686-TIPS.