A police officer shot in the head outside a public-housing complex in Brooklyn on Tuesday is expected to make a full recovery, police officials said Wednesday.

Officer Kevin Brennan, 29, a six-year veteran of the New York Police Department, was in plain clothes when he was shot around 9 p.m. after responding to reports of a man with a gun outside the Bushwick Houses on Bushwick Avenue and Moore Street in Brooklyn.

Hundreds of police swarmed the area after the shooting and arrested Luis Baby Ortiz, 21, who was found hiding in his uncle's apartment at 390 Bushwick Ave. about three hours later. Police also recovered the revolver that they believe Ortiz used.

Ortiz has two dozen prior arrests, mostly for drugs, and he is also wanted for the recent murder of Shannon McKinney, 34, in East Williamsburg on Jan. 1.

He's a bad dude. Everyone knows him around here, a Bushwick Houses resident told The Daily News.

This individual turned, fired one shot, striking Officer Brennan to the base of the skull, Police Commissioner Raymond Kelly said at a press conference on Wednesday. We believe Officer Brennan fired one shot in return. Ortiz was not hit.

Brennan was rushed to Bellevue Hospital, where he remained in critical but stable condition on Wednesday, Kelly said. Doctors successfully removed a bullet from the base of his skull, behind his right ear, and he is conscious and expected to survive, although he is still in a lot of pain, said his police partner, Lt. Christopher Devaney.

He's moving his arms and legs. He's having trouble with his vision, Devaney said.

Brennan is married and has a six-week-old daughter named Maeve. His wife, Janet, is with him in the hospital.

Thankfully, tonight I think there's no reason to think her daddy won't be there to see her crawl for the first time -- and in good time, dance at her wedding, Mayor Michael Bloomberg said at the press conference.