A retired NYPD officer was fatally shot in Brooklyn on Monday night, according to the city police department.

It appears the retired officer was accidentally shot in a confrontation outside a pizzeria in Brooklyn, according to sources.

Sources said the store owner asked the former officer to help him deal with a confrontation with an inebriated person near Church Avenue and East 3rd Street in Kensington around 7 p.m. Monday night.

The retired police officer, along with a retired Department of Correction officer, came over to help an 86-year-old man who was having a dispute with a 33-year-old man and a physical fight ensued, sources said.

The retired correction officer apparently pulled out a firearm, according to sources. While they were scuffling over the gun, one shot was fired, striking the 33-year-old and the former officer.

Sources said the 33-year-old was in stable condition, while the former police officer succumbed to his injuries at a nearby hospital.

The identities of those involved were not confirmed as of this writing.

Sources said the correction officer has not been arrested, but the the 33-year-old was taken into custody.