An off-duty NYPD officer is in custody after fatally shooting a man on Long Island Tuesday night, officials said.

According to the Nassau County Police Department, officers discovered a 25-year-old man with fatal gunshot wounds outside a home on Langdon Road in Farmingdale around 8 p.m.

Police Commissioner Dermot Shea confirmed during a press conference on Wednesday morning that the shooter was a member of the city's police department. "He was an NYPD officer that discharged his firearm," Shea said. "As a result of that discharge, an individual was struck in the head and killed."

Neither the victim nor alleged shooter have been publicly identified. The officer had an "ongoing dispute" with the victim, who did not appear to be armed, according to officials who spoke with ABC-7.

A source tells the Daily News that the officer was assigned to a precinct in Queens after graduating from the police academy a few months ago.

According to the News, the unnamed suspect was "hanging out with a few friends when two of them started fighting. He shot one of his friends to prevent him from harming the other, the source said."

The alleged shooter then returned home and told his father what had happened, the source added.

A spokesperson with Nassau County Police Department, which is handling the investigation, declined to shared details about the suspect. "We were told not to confirm employment," a public information officer told Gothamist.

Commissioner Shea said the investigation was active and in its early stages. It's unclear if charges have been filed.

According to data made public in 2016 following a lawsuit, approximately a quarter of all NYPD officers reside on Long Island.

This story has been updated with a statement from NYPD Commissioner Dermot Shea.