A police officer was wounded and a man was killed when a gunfight broke out in a crowded Harlem subway station sending people scrambling for their lives. Click below to find out more.

@WiLMajor

Suspect Michael McBride, 52, who had been wanted on suspicion of shooting his ex-girlfriend’s daughter in the head Monday in Queens, was fatally blasted in the chest by the cop he shot in the left bicep, sources said.

The wounded officer, Det. Kevin Herlihy, 47, was taken to Columbia Presbyterian Hospital. The father of three now has his wife by his side, sources said.

Rattled witnesses said they heard up to 20 shots in the station at W. 145th St. and St. Nicholas Ave. that sent them screaming and diving for cover behind benches and trash cans.

“It was ‘pow! pow! pow!’” said a woman who was at the station when the volley of bullets erupted at 4:30 p.m.

The woman said she saw five officers run into the station with guns drawn.

“It looked like they were going after somebody. The next thing, I hear shots,” she said. “It was so loud. When it stopped, I looked up and saw people on the floor. It was crazy. It was just a mess.”

Staphanger Edwin Pagan said he had entered the station to check his MetroCard when he found himself in the middle of the chaos.

“At least 17 shots rang out,” said Pagan of Harlem. “There was a woman with a baby carriage running behind me and everybody was trampling over each other.”

When the gunfire ceased, he said, he heard a detective standing over the mortally wounded suspect yelling “It’s over! It’s over!” to backup cops entering the station.

NYPD felony squad detectives from Queens, who used traced cell phone calls to determine McBride was hiding out at an apartment on 145th St., spotted the suspect driving a silver Kia minivan in the area, sources said.

When officers tried to pull McBride over, the minivan accelerated up W. 145th St. and turned into oncoming traffic on St. Nicholas, sources said.

The suspect abandoned the minivan in the middle of the street and took off running to the subway stop, with cops chasing after him, sources said.

Once in the station, McBride pulled a gun and fired, hitting the officer in the shoulder, sources said. Despite being wounded, the cop squeezed off rounds, hitting McBride in the chest.

“I heard bang, then three shots, then three more. People were running,” said George Peters, a lawyer who works on W. 145 St.

The explosion of violence happened just moments after police sent media advisory that said detectives were hunting for McBride for questioning in the Monday shooting.

Detectives believe McBride shot Shante Plowden, 25, his ex-girlfriend’s daughter, in the head about 1:35 p.m. Monday at an apartment on Beach 100th St. in Far Rockaway, Queens.

DN