In a summer marked by racial tensions, the latest debate has surfaced in a Boston suburb, where residents are divided over the mayor’s refusal to remove a “#BlackLivesMatter” banner that has hung for nearly a year at the town’s city hall.

Tensions rose in the historically blue-collar, majority-white town, Somerville, Mass., this week after Mayor Joseph A. Curtatone denied the police union’s request to replace the sign with another banner, one reading, “All Lives Matter.”

“Hanging the banner speaks to all lives,” Mr. Curtatone said of the Black Lives Matter banner in an interview on Friday.

In a letter sent to the mayor on Tuesday, Michael McGrath, president of the Somerville Police Employees Association, highlighted the killings of five Dallas police officers by a black veteran who voiced support for the New Black Panther Party and had told the police he was upset about Black Lives Matter.