An NYPD transit police officer shot and killed a knife-wielding man who slashed him in the neck during a confrontation in Coney Island Thursday, officials said.

The injured officer, Filippo Gugliara, 24, of Brooklyn, was listed in stable condition at Lutheran Medical Center where he was being treated for a superficial stab wound to his shoulder, Police Commissioner William Bratton told reporters.

Gugliara, who has been with the NYPD since January 2013, received a few stitches and was being kept at the hospital overnight because the wound punctured his skin, said officials.

photosRecent NYC mug shotsDataNYC crime rates

Bratton said doctors believe Gugliara was saved from serious injury when the shoulder strap of his protective vest deflected the knife. The knife was found a few inches from the suspect's body, noted Bratton.

The dead man, whose identity was being withheld late Thursday until his family was notified, was 58 and had a sparse criminal history that included a sealed complaint of aggravated harassment, said chief of detectives Robert Boyce.

According to police, Gugliara was on patrol above the street at the Ocean Parkway stop for the Q-line when he heard a commotion on Brighton Beach Avenue at about 1:15 p.m. Gugliara went down to street level and saw the assailant striking a 78-year-old woman who had fallen to the ground, Boyce said. The woman, who received several bruises, had tried to intervene in a dispute the man was having with another woman in a nearby store, police said.

advertisement | advertise on newsday

As Gugliara was trying to arrest the man, the assailant slashed at the officer with a 11-inch hunting knife, cutting the cop's neck, Bratton said.

The suspect ran and Gugliara fired two shots at him, hitting him in the torso, police said. The suspect, who had no known connection to the older woman, died by the intersection of Sea Breeze Avenue and West 1st Street, police said.

Bratton, with Mayor Bill de Blasio at a hospital news conference, said that Gugliara followed his training. "[He] did the right thing, went toward the danger," de Blasio said. "Was so good to see him, thank God, in great shape."

Gugliara was on patrol as part of a police "Safe Passage" program to help children get to and from school, said transit police chief Joseph Fox."All accounts are, our initial review, is that the officer performed admirably," Bratton said. "Quite clearly he faced a life-threatening situation with this individual."

Gugliara's action likely prevented more serious injury to the 78 year-old woman, added Bratton.

Get the Newsday Now newsletter!

The best of Newsday every day in your inbox.

With Alison Fox and amNewYork