A retired NYPD detective shot two of his adult sons during an argument at the family’s Long Island home before killing himself late Sunday, authorities said.

Retired Detective Irvin Noak, 61 — who has another son who is currently an NYPD cop — was having a party at his home on Fox Glove Circle in Bellport when he got into an argument with sons Aaron, 22, and Irvin Noak III, 30, around 11 p.m., Suffolk County police said.

The fight got so heated that the former cop walked to his bedroom and retrieved a handgun that he used to shoot the two younger men, cops said.

He then put the gun to his own head and pulled the trigger. He was rushed to Brookhaven Memorial Hospital Medical Center in East Patchogue where he was pronounced dead.

Aaron and Irvin III, who both live at the home with their father, were taken to the same hospital, where they remain in critical condition.

Click for more from the New York Post.