NEW YORK — The NYPD says a man was shot in the leg after he fired a gun toward police in Brooklyn.

Police say the suspect exited a car with a gun in his hand where a large crowd was gathered Friday night.

Three plainclothes detectives on patrol identified themselves as police and ordered “don’t move.”

Authorities say the man turned toward them and fired his weapon. During an exchange of fire with the officers, the suspect fled and was apprehended a block away.

The suspect suffered a gunshot wound to his left leg and was taken to a hospital in stable condition. The officers were not injured.

The suspect’s firearm was recovered.

Information from: WPIX-TV,