NEW YORK (AP) A rookie police officer responding to reports of a shootout was shot once in the leg, and authorities were investigating Friday whether he was wounded by a gunman firing off a rooftop.

Police Commissioner Raymond Kelly said Officer Jamil Sarwar was in the East New York section shortly of Brooklyn before 11 p.m. Thursday when he responded to reports of a shooting. He and his partner followed one of the suspects into the Cypress Hills housing development, where Sarwar realized he'd been wounded.

Kelly said police believe the round of gunfire that felled Sarwar was unrelated to the originally reported shootout. Detectives found shell casings on the roof of one of the buildings of the housing development. Kelly said it's not clear whether the officer was targeted or if the shot was random. Police were questioning two people but no arrests had been made.

The officer was released from the hospital on Friday and is expected to recover.

"He's in reasonable spirits, he's conscious, he's alert his family is with him," Kelly said.

Sarwar is originally from Bangladesh and has been on the job about 1 and years.

Mayor Michael Bloomberg visited the officer at the hospital Friday.

"Anytime one of our police officers is shot, it is a painful reminder that our success in fighting crime is fragile," he said.

Sarwar is the sixth officer shot this year. There were 12 struck by gunfire last year, but no fatal shootings since the 2011 death of Det. Peter Figoski killed in a botched robbery in December 2011 in the same neighborhood.

"But we cannot accept shootings as inevitable," Bloomberg said. "We must do everything we can to stop them. When a young police officer is shot while on routine patrol on the Fourth of July, there is no clearer message that we need to continue to do everything we can to keep guns off our streets."

The citizens group COP SHOT offered a $10,000 cash reward for information leading to the arrest and conviction of the suspect. Anyone with information can call (800) 267-7468.