A 66-year-old woman who attacked an NYPD officer with a baseball bat was shot and killed Tuesday afternoon in the Bronx, authorities said.

The shooting sparked community outrage and prompted Mayor Bill de Blasio to call the officer's response unacceptable.

"It never should have happened," the mayor said Wednesday afternoon during a news conference. "The NYPD's job is to protect life."

The mayor said there will be a full investigation of the incident.

"We need to know why this officer did not follow his training and did not follow those protocols," de Blasio said. "There were obviously other options here."

Police received a 911 call at about 6 p.m. from a person who reported that an emotionally disturbed woman was acting irrationally at a Pugsley Avenue apartment in the Castle Hill neighborhood, according to Assistant Chief Larry Nikunen.

A resident at the apartment complex told officers that the woman, later identified as Deborah Danner, was acting erratically on the seventh floor. Police Sgt. Hugh Barry entered an apartment, where Danner was seen brandishing a pair of scissors, investigators reported.

Barry was able to calm down Danner and get her to drop the scissors, authorities said. However, she then approached the sergeant and grabbed a baseball bat and started swinging it at him, they said.

Barry fired two shots, hitting Danner in the torso.

Barry, an eight-year veteran of the force, has been placed on modified duty. He has no prior involvement in shooting incidents, the department said, but he has been sued twice in the past for brutality, the New York post reported.

The NYPD settled a 2012 lawsuit in which Barry was accused of dealing beatings with his fists, feet or baton and violating the civil rights of the victim, who is a racial minority.

The 2014 lawsuit alleges that Barry, one of four named and 20 unnamed defendants, was involved in a racially-motivated beatdown of three Latino men ouside of a nightclub in the Lower East Side in 2011, the Post reported.

One victim's case went to trial, but he did not receive any monetary compensation, the Post reported. The other two plaintiffs each received a settlement.

Barry did have a Taser on Wednesday, which wasn't used during the confrontation.

NYPD Commissioner James O'Neill said the department's investigation into the shooting will look at why the sergeant didn't use his Taser.

"We failed," O'Neill said of the shooting.

Bronx Borough President Ruben Diaz Jr. condemned the shooting in a news release.

"This elderly woman was known to the police department, yet the officer involved in the shooting failed to use discretion to either talk her down from her episode or, barring that, to use his stun gun," he said. "That is totally unacceptable."

Community Access, a nonprofit that provides services to people with mental health concerns, released a statement suggesting NYPD officers need more training to handle someone who is considered emotionally disturbed.

"Last year the NYPD began training Crisis Intervention Teams to respond in a humane and appropriate way to people experiencing emotional distress," said Steve Coe, CEO of the organization. "The NYPD agreed to train 5,000 officers. We called on them to train more. These types of incidents escalate way too often and the results are too often tragic. We need to do more to prevent these senseless deaths."

Public Advocate Letitia James also issued a news release in which she said she is "deeply concerned" about officer's response to an emotionally disturbed woman.

"While we are still learning details about this evening's incident, I am renewing my call to expand the use of non-lethal use of force by the NYPD," she said.

Gary Kane contributed to this report.