BOSTON - A Boston police officer who was part of a team on a regular patrol was shot Sunday in the city's South End, but did not suffer life-threatening injuries.

Boston Police Commissioner William Gross told reporters the shooting is yet another example of “too many guns on the street.” It's also the latest incident of violence directed at Massachusetts police officers. Two local officers have so far been shot to death this year.

“It is our job to patrol and to protect the people of Boston,” he said. “Unfortunately, some people take that out against us.”

Gross said members of the Youth Violence Strike Force had come across a vehicle double-parked, with blaring music, when they noticed three men in their 20s sitting on the steps of an apartment building. After making eye contact with the officers, Gross said the men stood up and clutched something at their waists, which he said were the “characteristics of an armed gunman.”

The men then went into the apartment building and tried to hold the door closed to prevent the officers from entering, Gross said. After eventually gaining access to a common hallway, one of the officers was shot in the calf. The officer was taken to Brigham and Women's Hospital, where Gross said he was “doing fine.”

Police quickly had to treat the shooting scene as a potential hostage situation after receiving a report that one of the suspects barricaded himself inside one of the building's apartments. The department's SWAT team and hostage negotiators responded and set up a line of communication with the man.

“Thankfully it came to a peaceful resolution,” Gross said, adding how police were seeking a search warrant to enter the apartment, where he said he expected to find a weapon. An Associated Press photographer reported seeing a large police presence at the scene, including officers carrying assault-style rifles and wearing helmets.

Gross said three people were eventually taken into custody and no further shots were fired.