SMITHTOWN - Two city cops from Long Island are recovering after being shot on the job during a hostage situation in Brooklyn.

Police Capt. Al Pizzano, of Smithtown, and Officer Matthew Granahan, of Nesconset, were two of the four NYPD officers shot early Sunday morning.

According to police, ex-con Nakwon Foxworth had been holed up with his pregnant girlfriend and their 4-month-old son. When mother and child escaped, cops ran into the apartment and Foxworth allegedly fired 12 shots.

None of officers has life-threatening injuries.