A man, who police say had a gun, is recovering after being shot by police inside a Queens housing complex.

It happened around 9:30 Friday night at the Baisley Park Houses on Guy R. Brewer Boulevard.

Investigators say a plainclothes lieutenant and an officer were doing patrols in a building when they came across 38-year-old Jamel Ethridge.

"As they entered the second floor stairway, they encountered a male with a firearm in his hand," said NYPD Assistant Chief David Barrere, commanding officer for the Queens South patrol. "During this encounter both the lieutenant and the officer fired their weapons, striking the perpetrator one time in the left leg. The perpetrator was transported to Jamaica Hospital."

Police say they told Ethridge to put down the gun before opening fire.

He's now in the hospital with non-life threatening injuries.

Authorities recovered a 9-millimeter handgun from the scene.

Police say Ethridge has an extensive criminal record that includes charges for attempted murder and criminal possession of a firearm.