DORCHESTER (CBS) – A Boston Police officer shot a man in the leg while trying to stop a stabbing in Dorchester overnight.

Two officers were on patrol on Adams Street around 11:30 p.m. Monday when they saw two men fighting outside of a sandwich shop. Then, one of the men, later identified as 32-year-old Luis Gomes, of Dorchester, started stabbing the other.

READ MORE: Wife Of New Bedford Police Sergeant Who Died From COVID-19 Fights For Benefits

The officers jumped out of their cruiser and tried to separate the men. Gomes then went after police, according to Commissioner William Gross.

“One officer physically tried to separate the knife-wielding suspect from further stabbing the victim. It was a very violent attack. As a matter of fact, the victim was stabbed in the neck and twice in the back and, again, that officer tried to physically intervene and remove that suspect from the victim. That was to no avail,” Gross told reporters.

“The suspect then turned on to the officer, wielding the knife and attempted to stab the officer. Being in fear of not only of the stabbing victim’s life as well as the officer, the officer’s partner discharged the department-issued firearm striking the knife-wielding suspect in the thigh.”

The commissioner said the officers immediately began first aid on Gomes and put a tourniquet on his leg.

Both men were taken to local hospitals and are both listed in stable condition.

READ MORE: Firework Thrown From Car Sparks Fire In Franklin; Police Search For Driver

The officers were not hurt. The victim’s identity has not been released.

Police are searching the area for surveillance video and asking any witnesses to call them. It’s unclear what started the fight.

In one cellphone video, you can hear angry bystanders screaming at police, “You didn’t have to shoot him.”

A friend of Gomes, who did not want to show her face on camera, said she heard officers demand Gomes drop his weapon multiple times, then she heard a gunshot.

According to the friend, Gomes suffers from addiction. “I can’t see him doing that. That has to be drugs,” she said.

MORE NEWS: Are COVID Tests Accurate For Variants? Dr. Mallika Marshall Answers Your Questions

Gomes is expected to be arraigned on charges of armed assault with intent to murder and assault by means of a dangerous weapon.