A cop-hating gunman on a wild shooting rampage through West Philadelphia killed a woman, injured two officers and three more bystanders before he was shot and killed by police late Friday night.

Cops found a “rambling” note expressing hatred of police and probation officers near body of the 25-year-old shooter, identified as Nicholas Glenn of West Philadelphia.

The shootout was “a completely bizarre situation,” Philadelphia Police Commissioner Richard Ross said.

Glenn walked up to Sgt. Sylvia Young’s patrol car not far from the University of Pennsylvania campus shortly after 11 p.m. Friday and opened fire. He pumped out more than a dozen rounds, hitting the 19-year department veteran in the left arm and bullet-proof vest multiple times.

“She didn’t hear him say a word, [he] just walked up on her and started firing,” Ross said.

The madman then took off, running to a bar where he again started shooting, hitting a security guard in the leg. He then grabbed a woman, using her as a human shield before shooting her in the leg.

Moments later, as he was being chased by police, Glenn fired into a car, hitting a man and woman. That woman, who was struck seven times, died just before 2 a.m. Saturday. The man who was with her is in critical condition.

Glenn reportedly next ducked underneath a partially opened garage door at a Toyota dealership and hid among stacks of the tires, staff told Philly.com. The dealership cleaning crew saw him, but he didn’t see them, according to the report.

The shooter fled again before police cornered him in a nearby alley, where two city cops and University of Pennsylvania police officer Ed Miller shot and killed him. Miller was wounded in the exchange.

Young, Miller, the security guard and the woman shot in the leg were in stable condition.

with Post Wire Services