(CNN) -- A 29-year-old New York City police officer is recovering from two gunshot wounds from an on-duty chase, city officials said.
Officer Richard Ramirez, a four-year member of the force, was patrolling an area of Brooklyn as part of a "three-man anti-crime team" Sunday night, New York City Mayor Michael Bloomberg said from the hospital where Ramirez was being treated.
New York Police Commissioner Raymond W. Kelly said the three officers were in an unmarked vehicle and noticed someone riding a bicycle on a sidewalk. The officers got out of the vehicle to question the bicyclist, who fled.
"As he was running, he kept turning, tucking something into his belt," Kelly said.
"The perpetrator ran into a building and up to the third floor where he turned and fired on the officers, hitting Officer Ramirez twice in the right leg," Bloomberg said. "The three officers returned fire and wounded the perpetrator."
Doctors expect Ramirez to make a full recovery, Bloomberg said. Kelly said the perpetrator was struck three times and was hospitalized in critical but stable condition.
The commissioner said police were trying to make a positive identification on the perpetrator.
Kelly said guns in the wrong hands can kill police officers and innocent civilians.
"Let me just repeat once again, there are just too many guns on the streets in the hands of criminals and in the hands of young people," Kelly said.
"In this country, we have a Virginia Tech virtually every single day," the police commissioner said, referring to the 2007 massacre at the university. "Thirty-two people were killed at Virginia Tech; there's roughly 32 people that are killed with illegal handguns every single day in our country."