A New York City police officer who died Sunday while trying to arrest an armed suspect was shot and killed by fellow officers during a violent struggle, police officials said Monday.

Police Commissioner James O'Neill said Officer Brian Mulkeen, 33, was shot twice by police gunfire during the Sunday confrontation in the Bronx.

"This is a tragic case of friendly fire," O'Neill said during a news conference at police headquarters.

The suspect, Antonio Williams, 27, died at the scene. Investigators previously suggested that Williams wrestled away Mulkeen's gun while the pair were on the ground.

Officials said the nearly seven-year department veteran retained control of his weapon and fired several shots during the encounter.

RETIRED NYPD SERGEANT REPORTEDLY KILLS HIMSELF AMID DEPARTMENT'S 'MENTAL-HEALTH CRISIS'

Mulkeen and two plainclothes officers were on patrol near a city housing complex around 12:30 a.m. during an investigation into potential gang activity.

During the questioning of Williams, he allegedly fled behind a building. Mulkeen, a former college track star, tackled Williams, who went after the officer's weapon during a struggle, according to the NYPD.

Mulkeen's body camera captured him saying: "He's reaching for it! He's reaching for it!"

“Mulkeen retained his firearm during the entire violent struggle he had with this suspect,” said O’Neill. “He fired five rounds at the suspect.”

Investigators determined several officers fired 10 shots. Mulkeen, though wearing a bulletproof vest, was hit in the head and torso, officials said.

They said the torso shot exited his body through his thigh. He was taken to a hospital where he later died.

“It was a violent struggle and from start to finish, from first round to last round, was 10 seconds,” the commissioner said, according to the New York Post. “Just think about that. Think about how quick that is.”

Investigators found a .pistol they said belonged to Williams. It was never fired, they added. Williams was on probation until 2022 for a drug-related arrest last year. He had several prior arrests, and his record includes a burglary conviction, NYPD officials said.

CLICK HERE FOR THE ALL-NEW FOXBUSINESS.COM

It was unclear if any of the rounds fired by Mulkeen struck Williams.

Mulkeen's death is the second of an NYPD officer from friendly fire this year. Queens Det. Brian Simonsen died in February after he was struck in the chest as he and six officers fired 42 shots at a robbery suspect who mimicked pulling the trigger of a fake handgun.

"We've been here too often. We know the directions to get here," Patrick Lynch, the president of New York City's Police Benevolent Association, said at the press conference. "It has to stop."

The Associated Press contributed to this report.