BROOKLYN - NYPD officials say a man with a gun was fatally shot by police outside of an East Williamsburg housing project Sunday morning.

Authorities say they got several 911 calls about an emotionally disturbed person and an armed robbery at the Cooper Park Houses on Debevoise Avenue. Officers arrived at the scene around 7:45 a.m.

The NYPD says Jermaine Johnson threatened tenants and exchanged fire with police. They say he fired five times and officers returned fire at least 12 times.

Johnson, who was in his 30s, was pronounced dead at Woodhull Hospital.

Officials say a .40-caliber semiautomatic handgun was recovered at the scene.

The two officers involved in the incident were taken to Elmhurst Hospital for observation.

People who were robbed by Johnson were taken to the station house to be looked after, News 12 is told.