A New York City Police Department detective was released from the hospital Friday just hours after being shot in the leg. 

Police say it all began when two detectives spotted Kelvin Stichel around 6:30 a.m. on Decatur Street in Bedford-Stuyvesant.

He was wanted for a domestic robbery involving a gun.

Authorities say Stichel pulled out this .45 caliber handgun and shots were fired.

Miguel Soto, a seven year veteran of the force, was hit in the right leg and taken to Kings County Hospital.

Stichel has numerous prior arrests, one for assualting an officer.

"We should be grateful of the outcome today particularly after yesterday's one year anniversary of the brutal murder of detective Miosotis Familia in the Bronx," said NYPD Commissioner James O'Neill.

Police say the suspect was shot in the left arm and is at a hospital in police custody.