A 27-year-old man bit off a piece of an officer’s ear after police responded to a domestic violence call in Massachusetts, according to prosecutors.

Suffolk District Attorney Kevin Hayden said a judge ordered Carlos Sanabria to be held without bail pending a dangerousness hearing, which is set for later this month.

“A dangerousness hearing is entirely appropriate here to ensure the safety of first responders and the larger community. This is an example of how unpredictable domestic violence calls can be for police officers, and how rapidly their day-to-day responsibilities can turn chaotic,” Hayden said in a news release. “This officer was injured in the line of courageous duty, and I wish him a quick recovery.”

The judge also ordered Sanabria, who was arraigned on Tuesday, to be evaluated by a medical professional.

In the release, Hayden said officers responded to the Chelsea Community Center for a domestic violence call on Aug. 30.

At the scene, Hayden said Sanabria was “being uncooperative” when an employee from the community center told police the suspect had a video of “a domestic incident involving his girlfriend.” While police asked to see the footage, Hayden said Sanabria refused to show them the video and became increasingly upset.

“As Sanabria left the building, he began yelling at an officer before charging at him and throwing punches,” according to the release. “The officer attempted to place Sanabria under arrest when both fell to the ground in a struggle, with Sanabria on top. Sanabria continued to punch the officer and had the officer’s hands pinned down. Sanabria then bent his head down and bit the officer’s ear, tearing a piece of it off.”

Hayden said a second officer put Sanabria in a chokehold and shot him with a stun gun, hitting him in the back. Officers then handcuffed him.

“The officer was immediately treated and transported to a local hospital for further medical attention,” Hayden said.

The dangerousness hearing is set for Sept. 20.