NEW YORK — A New York City police detective has been released from the hospital hours after he was shot in the leg while chasing a wanted man in Brooklyn.

Commissioner James O'Neill said Friday that suspect Kelvin Stichel wounded Detective Miguel Soto once in the upper right thigh.

O'Neill says Soto and his two partners returned fire and Stichel fled. He says Stichel was found in a nearby building with a right forearm wound.

O'Neill says Stichel was wanted for a domestic violence-related armed robbery when warrant squad officers spotted him walking down the street around 6:40 a.m.

The 33-year-old Stichel remains in custody. He was hospitalized in stable condition. Information on his lawyer wasn't immediately available.

Soto was awarded a medal of valor in 2016 for chasing down an armed man.