SOMERVILLE, Mass. — About 50 police officers and their supporters upset about a Black Lives Matter banner that has been hanging outside City Hall for a year rallied on Thursday to try to pressure the mayor to remove it.

The primarily white opponents of the banner broke into chants of “All lives matter!” and “Take it down!” Many held signs saying “Cops lives matter” and “Support your local police.”

Harold MacGilvray, president of a coalition representing 1,500 officers in 26 communities, said a public building like Somerville’s City Hall is “no place” for political slogans to be displayed.

The mayor of Somerville, a largely white and historically working-class Boston suburb, had earlier in the day promised not to remove the banner despite complaints from officers across the state.

Mayor Joe Curtatone, a white Democrat, said Thursday afternoon it’s “OK to disagree” and the only way to resolve the impasse is through an “open dialogue” about race.

“That sign is not coming down,” he insisted while standing in front of City Hall flanked by the police chief and two deputy chiefs.

The Somerville Police Employees Association was among the unions represented at the opposition rally Thursday evening outside City Hall. Its president, Michael McGrath, said his officers support the “core goal” of the Black Lives Matter movement but believe the banner sends an “exclusionary message” and is disrespectful to officers.

“In the face of the continuing assassination of innocent police officers across the country … it is irresponsible of the city to publicly declare support for the lives of one sector of our population to the exclusion of others,” McGrath said in a statement this week.

As the police rally was breaking up, some Black Lives Matter supporters held signs saying “All lives can’t matter until black lives matter” or thanking the mayor for his stand.

Curtatone, the son of Italian immigrants and the mayor since 2004, has argued that standing up for minority residents and supporting police aren’t “competing interests.” He noted the city has hung a banner over police headquarters honoring officers slain in Dallas and in Baton Rouge, Louisiana.

“Both of those banners are hanging for the same reason: Too many people have died in a cycle of violence that needs to be stopped,” he said in a statement.

When asked whether he thought it was appropriate to place the Black Lives Matter banner on a government building, he replied: “No one can sit out this conversation. Where this is happening is in cities. This is the grassroots level.”

Curtatone hung the 4-foot-by-12-foot banner over City Hall’s main entrance in August 2015 at the request of a local Black Lives Matter chapter. He said then it was meant to recognize that “structural racism” exists in society and stressed it wasn’t a criticism of his police department.

The police banner hangs over the police headquarters entrance and says, “In honor and remembrance,” with an image of the Dallas Police Department badge and a black band across it.

Last week, the city police union called on the mayor to replace the City Hall banner, which says “#BlackLivesMatter,” with one that states “All Lives Matter,” a phrase some civil rights activists complain diminishes their concerns about the killings of black men and boys at the hands of police.

In response, police Chief David Fallon, who supports keeping the banner over City Hall, chided the union for getting involved in the debate.

Curtatone said opposition to the banner wasn’t shared by all police officers. He also said he’s “proud” of the response from residents, community leaders, faith-based leaders and activists, and he rejected the notion officers would face reprisals if they attended the opposition rally.

Somerville is a city of more than 80,000 residents that borders Boston and Cambridge and is home to most of Tufts University’s campus. It is about 74 percent white, 11 percent Latino, 9 percent Asian and 7 percent black, according to 2010 U.S. Census data.