A gunnman first ambushed a Philadelphia police sergeant late Friday night and then went on a shooting rampage killing a young woman and wounding two law enforcement officers and three other civilians before police shot him to death.

Philadelphia Police Commissioner Richard Ross identified the gunman Saturday as 25-year-old Nicholas Glenn, of West Philadelphia.

The shooting rampage started about 11:18 p.m. when Glenn walked up to a marked police cruiser at 52nd and Sansom Streets and just began firing, police said.

Sgt. Sylvia Young, 46, who was sitting inside the car, was shot several times after Glenn fired off 18 shots, Ross said at a Saturday afternoon news conference. Her gun was hit as well. A 19-year veteran assigned to North Philadelphia's 22d Police District, Young on Friday was working with a task force in West Philadelphia.

She and another officer, who was later shot - University of Pennsylvania officer Eddie Miller, 56, a former Philadelphia police sergeant who joined Penn's force two years ago - were both in stable condition Saturday at Penn Presbyterian Medical Center.

One of the four civilians who was shot, Sara Salih, 25, who was sitting in a car at 49th and Sansom Streets, near where she lived, died. She was shot seven times in her torso and was pronounced dead at Penn Presbyterian at 1:56 a.m. Saturday.

The three other civilians who were shot - a 36-year-old man shot twice in his left arm and once in his right arm; a 42-year-old man shot twice in his left leg; and a 41-year-old woman shot once in her right ankle - were all in stable condition at Penn Presbyterian Saturday afternoon, police said.

"A horrific night," Ross said.

After shooting the sergeant, then attempting to flee, Glenn shot a security guard and a patron at a bar. He then fired 14 times at a man and a woman inside a vehicle, killing the woman, Ross said. The man in the vehicle was initially listed in critical condition; police Saturday afternoon said his condition was stable.

In the hours after the shootings, police flooded the area looking for possible accomplices, but after a couple hours determined that the shooter had acted alone.

"We believe this is isolated to this individual," Ross said while briefing reporters early Saturday morning outside Penn Presbyterian.

Police gave this account of what happened Friday night:

At 11:18 p.m., Sgt. Young was in a marked police cruiser at 52nd and Sansom Streets when the gunman approached. He started firing.

"She didn't hear him say a word," Ross said, who added that the gunman did not know her.

Young, trapped in the vehicle, couldn't do anything but lean over into the passenger side until the firing stopped, Ross said.

She heard at least 15 shots. She was struck in her left arm and in her protective vest.

Other officers, seeing that Young had been shot, started chasing the suspect east on Sansom.

On Sansom Street, near 51st, he fired into a bar, the Maximum Level Lounge, wounding a security guard. Then, he grabbed a woman and "uses her as a shield," Ross said.

Then the suspect shot her in the leg and resumed running east on Sansom.

At 49th and Sansom, he came across a white vehicle and fired multiple times into it, striking a man and the 25-year-old woman in the torso seven times. The woman died.

Miller, the Penn officer, was cracking jokes, the mayor added.

"All in all, it was a terrible scary night," Kenney said.

The mayor said he wanted to thank all police officers for their service and remind them to wear their vests.

Effective immediately, officers will be patrolling in pairs, Ross said.

As word came out on the shootings, local and national figures began tweeting on it, including Philadelphia District Attorney Seth Williams, who wrote: "Please keep the @PhillyPolice SGT, @PennDPS P/O shot tonight their families, friends & co-workers in your prayers as they deal w/ trauma."

Republican presidential candidate Donald Trump tweeted:

"My thoughts and prayers go out to the @PhillyPolice & @Penn police officers - in Philadelphia."

In a statement Saturday, Pennsylvania Gov. Tom Wolf thanked law-enforcement officers and said in part: "Our thoughts are with the officers and other victims of this horrifying violence."

University of Pennsylvania President Amy Gutmann said in a statement that she was able to see Officer Miller at Penn Presbyterian Saturday morning. She said she was "so relieved and pleased to report that he is getting excellent care and will fully recover from his wounds." She thanked Miller, Sgt. Young and other officers for their bravery.

"In these challenging and difficult times for our country, there is no place that is immune to such senseless outbursts of violence," she said. She said the Penn community's thoughts and prayers are with the victims and their families.

The ambush on the police sergeant was reminiscent of the Jan. 7 nighttime shooting when a gunman walked up to a patrol car at 60th and Spruce Streets in West Philadelphia and without warning, shot and seriously injured Philadelphia Police Officer Jesse Hartnett, now 34.

The alleged gunman in Hartnett's shooting, Edward Archer, now 31, of Yeadon, later confessed to police that he had carried out the shooting "in the name of Islam" and said he had sworn allegiance to ISIS, authorities have said.Archer, in custody, faces trial on attempted murder and related charges.