A suspected gunman was injured early Friday morning after being shot by police officers in Brooklyn.

It happened around 1:30 a.m. at the corner of Rochester Avenue and Stirling Place in Crown Heights.

Investigators say three plainclothes officers from the Brooklyn North Gang Unit heard reports of shots fired at the scene and arrived in an unmarked car.

There, they say they saw a man being chased by a 20-year-old man firing a gun.

"The officers exited their vehicle, gave tactical commands of 'Police, don't move,' at which time those commands were ignored and the male continued to run towards them. A sergeant who was one of the men in the vehicle, one of the officers in the vehicle was a sergeant, he exited the vehicle at that point and discharged his weapon at least two times striking the male one time in the thigh," said NYPD Patrol Borough Brooklyn North Commanding Officer Jeffrey Maddrey.

After getting hit, they say the man threw away his gun and ran off, before collapsing less than a block away.

He was taken to to the hospital and is expected to survive.

A 25-caliber pistol was recovered at the scene.