An off-duty NYPD sergeant committed suicide in his Brooklyn home Sunday while his family members were nearby in other rooms, law-enforcement sources said.

Sgt. Jim Fitzpatrick’s wife made the horrific discovery at around 3:45 p.m. at their home near Narrows Avenue and 71st Street in Bay Ridge, officials and neighbors told the New York Post.

His wife, Gina, and their two children were home when Fitzpatrick went into the family’s master bedroom and pulled the trigger of his NYPD service weapon, sources and neighbors said.

Fitzpatrick was rushed to Lutheran Medical Center, where he later died, sources said.

Police sources and neighbors said the 48-year-old officer was assigned to Metro Tech in Downtown Brooklyn.