An NYPD detective was shot in the arm during a wild gun battle in a Harlem subway station today but he was amazingly able to return fire and kill the suspect, officials said. Career criminal Michael McBride and Queens detective Kevin Herlihy fired as many as 19 shots during the 4:20 p.m. chaos sending terrified straphangers running for cover in the crowded station at St. Nicholas Avenue and West 145th Street. McBride, 52 who was wanted for shooting his ex-girlfriends daughter in the head on Monday died at the scene with a gunshot to the chest. Michael McBride, who was wanted by cops for the brutal shooting of a 21-year-old woman in the Rockaways yesterday, was shot dead today in an exchange with cops. Herlihy, 47, who was part of a five-man team hunting McBride, was rushed to Columbia Presbyterian Hospital and is in stable condition. Im happy to say all indications say that he will walk out of here and go home to his family and his wife Adrian, Mayor Bloomberg said of the 18-year-veteran, who has two sons, 11 and 6 and a daughter who is 13 months-old. We are incredibly grateful that detective Herlihy is alive. He and his wife are in good spirits... He is the kind of detective we want out there protecting all of us. The bloody mayhem erupted as Herlihy and his team from the Queens Violent Felony Squad tracked down McBride to the neighborhood where he used to live through his cell phone, sources said. They first spotted him walking from Bradhurst Avenue to St. Nicholas. He realized he was under surveillance and ran toward the subway fleeing underground down a staircase, sources said. He got into the station quickly and they were concerned hed get on the subway, Police Commissioner Ray Kelly. They were running after him. Herlihy caught up with McBride near the token booth inside the station, which was already bustling with rush hour foot traffic, the sources said. McBride, armed with a .22 caliber pistol, whipped around and immediately began blasting firing four to six shots the sources said. One of the bullets struck Herlihy, who lives in Lynbrook, LI, in the left arm, authorities said. Another foot over, and it would have been in the middle of his chest, a source said of the bullet, which exited Herlihys arm. The injured Herlihy managed to fire back using his right hand, squeezing off 13 shots, the sources said. After McBride was struck, he managed to stumble up one flight of stairs toward the street before collapsing on the landing. He was declared dead at the scene, where his weapon was recovered nearby. McBride had been wanted in the brutal shooting of Shante Plowden, the daughter of his estranged girlfriend who he had been living with until recently on Beach 100th Street in Queens, police said. The thug went to his exs home around 1:30 p.m. Monday to get some of his clothes, and thats when he got into an argument with Plowden, sources said. Video footage shows that the pair exchanged heated words in the ninth-floor hallway outside the apartment. McBride then grabbed the young woman and dragged her down the hallway and out of the cameras sight, where he shot her at least once in the head and possibly again in the leg, source said. He can then be seen coming back into frame without her and fleeing. Plowden remained in critical condition at North Shore Medical Center in Manhasset, LI, today but was miraculously talking even with the bullet still lodged in her head, sources said. Its a miracle shes alive, one law-enforcement source said, adding that doctors were amazed at her survival. A neighbor of Plowden said she came home to find the hallway soaked in blood. I thought it was my place. I was shocked when I came home last night, she said, noting that the blood was on the walls, the floor. I was just like, wow! Detective Herlihy is the second cop shot in the city in two weeks. Police Officer Kevin Brennan took a bullet to the head chasing a perp Jan. 31 but miraculously survived. Another cop, Peter Figoski, was been fatally shot in the head while on duty the month before. Mike Palladino, head of the Detectives Endowment Association, said: We were very lucky ... But if these thugs think that its open season on cops, I strongly recommend they think twice. Todays subway station shooting stunned straphangers. I heard the shots ... and when I turned around, I saw somebody dead. He was on the landing face-down in blood, said witness Edwin Pagan, 47, who was exiting the subway station at the time. One witness added that pandemonium broke out among subway riders amid the gunfire. Little kids were like, Theyre shooting! Theyre shooting! said the witness, who didnt want his name used. I walked right up the top of the station and saw [McBride]. The guy was dead, and he was cuffed. After a few minutes, they started pumping his chest, but he was already dead. Wanna kill these ads? We can help!