Police say 26-year-old Officer James Li got into a gun battle with the suspect at Utica Avenue and Empire Boulevard in Crown Heights. One man was taken into custody, but the manhunt continues for a second suspect.
Rashun Robinson, 28, has been arrested on attempted murder, assault, weapon possession and other charges.
Robinson didn't even make an attempt to get bail Thursday night.
He was arraigned in Kings County Criminal Court on a number of felony counts, including the attempted murder of a police officer.
"The question was put to him, why did you shoot? 'Because I hate cops.' No other reason," said Pat Lynch, PBA President.
The incident began around 5 p.m. Wednesday, when Li and his partner spotted the two men enter a bus through the rear doors. They got on the bus and removed the men, who ran once they hit the street.
The suspect then fired at the officers, who both fired back. Witnesses reported hearing as many as 20 shots ring out. Li was hit in both legs, specifically leg, groin and thigh.
The off-duty EMTs, identified as Khadija Hall and Shaun Alexander, grabbed their equipment and rushed to the scene to aid Li, who was lying on the sidewalk. Both women have more than 20 years on the job.
The gunman escaped, but thanks to civilians and nearby residents, police were directed to a nearby building, where they found Robinson hiding out in a fifth-floor hallway.
"The fact that citizens immediately came to the aid of the fallen officer, the fact that citizens pointed out to the other responding officers where the perpetrator had gone, this is something all New Yorkers should also be proud of," Mayor Bill de Blasio said.
Police say Robinson was carrying a loaded .45-caliber weapon. They say Robinson's wanted in Pennsylvania on drug charges.
Li was taken to Kings County Hospital in stable condition.
Police officials say this is just another example of how seemingly routine police work can be the most dangerous.
"A dangerous felon is now off the street, another firearm off the street," NYPD Commissioner William Bratton said. "All as a result of very good police work by two rookie police officers who I am pleased to have as members of the New York City Police Department."
Both officers graduated from the Police Academy in December.