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 said.

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.

After finding her husband on the bedroom floor, Fitzpatrick’s wife came running out of the house screaming, “He’s been shot!” neighbors said.

“I heard a scream. Not like a normal scream, but like something really happened,” said a neighbor, Mark Pedziwiater, 45. “The worst thing is that the kids were home.”

Neighbor Debbie Stosko described Fitzpatrick as very family-oriented.

“His son played ball with my son,” she said. “He was a family guy. He took his kids to all the sporting events. He was all about his kids.

“He was big, tall, stocky, like a big teddy bear,” Stosko added. “When you saw him, you would be intimidated, but then he’d crack a smile and put you at ease.”

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

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