Police say Korpalski spotted David Ellis, 29, at Magee Street and Torresdale Avenue - 21/2 blocks from Ditman - and got out of his police van.
At that point, police say, Ellis fired at Korpalski and his partner.
"He was met with gunfire as soon as he got out of the car," Ramsey said.
Korpalski was hit once on the left side of the head, police said. Crying out that he was hit, Korpalski was able to return fire, along with his partner and two other officers, Ramsey said.
Ellis, who emptied his .32-caliber revolver at Korpalski and the others, was hit multiple times, police said. He was later transported to Aria-Torresdale hospital, where he died at 1:35 a.m.
In the volley of gunfire, bullets struck the police van, nearby cars, and the sides of a building, and one pierced a storefront window.
In police radio recordings broadcast on several television stations, Korpalski said calmly, "I'm hit."
Fellow officers rushed Korpalski, the son of a retired police officer and the father of a three-week-old baby, to Einstein Medical Center. Another officer rode in the back with him.
"The officer is OK right now," he told police radio. "He's talking."
"Even though [Korpalski] was bleeding pretty good, his adrenaline kicked in and he did what he had to do," Ramsey said. "It highlights the dangers faced every day."
Betty Ellis, David Ellis' grandmother, said she was not sure what had happened in the early hours Tuesday. She said her grandson had gotten into an argument with his girlfriend, "had something to drink," and left his home.
"Past that, I don't know," she said.
Betty Ellis said a medical examiner had told her that her grandson had been shot 14 times.
"I admit that if he had a gun and he aimed it at the police, he was wrong," she said. "But they did not have to shoot him 14-plus times. . . . All I know right now is, they murdered my baby."
As in all police-involved shootings, Internal Affairs detectives and the District Attorney's Office will investigate.
Betty Ellis said she had raised her grandson from the age of 3. She described him as "a good kid, a quiet kid," who attended Catholic school.
"I tried to do everything I could do right," she said. "My heart is broken forever."
Police said Ellis had been arrested eight times, for crimes including drug dealing, assault, and firearms offenses. He had been paroled to a halfway house in August 2013 after a five-year prison term for carrying a firearm and possessing cocaine, crack, and marijuana. He was denied parole twice before his release.
In granting him parole, records show, the Board of Probation and Parole cited "positive institutional behavior" and a "positive recommendation made by the Department of Corrections."
Fraternal Order of Police Lodge 5 president John McNesby said police officers have to "look over our shoulders" thanks to "a parole system that lets people out and a probation system that's lax."
Betty Ellis said her grandson had been trying to turn around his life since his release, getting a job at a Center City restaurant.
FOP vice president John McGrody said he had spoken to Korpalski's family Tuesday. The officer, he said, was resting at home.
"He's glad to be home and glad to be alive," he said.