ROME — A man draped in Italy’s tricolor flag wounded at least six “people of color” in a drive-by shooting in a central Italian city Saturday before being detained, authorities said. The suspect had been a candidate for the anti-immigrant Northern League party in municipal elections last year, according to a party spokeswoman.

The suspect’s motive in the shootings in Macerata was not known, but a young Italian woman was gruesomely murdered in the city last week, allegedly by a Nigerian immigrant, prompting a wave of anger in a nation where many were already seeking to reduce the entry of migrants.

The attack’s connection to the Northern League was likely to unsettle Italy as it approaches national elections March 4. Far-right groups have been gaining in the polls, and the Northern League looks as though it may have a chance to govern as a junior member of a coalition with other right-wing parties.

A police spokesman said 28-year-old Luca Traini was detained near Macerata’s central war memorial early Saturday afternoon. A handgun was in the suspect’s car, and the green-white-and-red flag of Italy was tied around his shoulders, the official said. Traini admitted his guilt as he was arrested, added the spokesman, who declined to be publicly identified under ground rules set by the force. The five men and one woman who were shot were expected to recover, Macerata Mayor Romano Carancini said.

Local news outlets said the man was detained after he stepped out of his black Alfa Romeo 147 near the memorial, gave a fascist salute, and shouted “Italy for the Italians.” It was not clear whether the victims were Italian citizens.

After the attack, Italian Prime Minister Paolo Gentiloni called on political leaders on all sides to stop a “cycle of violence.”

“Let’s stop this risk, let’s stop it now, let’s stop it together,” he said in a nationally televised statement from his residence, the Palazzo Chigi, in Rome. “Hate and violence won’t be able to divide us.”

Large numbers of migrants began sailing across the Mediterranean toward Italy after Libya plunged into lawlessness and civil war following the 2011 downfall of Libyan dictator Moammar Gaddafi. More than 620,000 migrants, many of them African, have arrived in Italy since the beginning of 2014, contributing to a growing sense among Italians that the country was taking in far more people than it could handle.

Anti-immigrant sentiment has become a main theme in the campaign leading up to next month’s elections. Northern League leader Matteo Salvini has vowed to expel 150,000 immigrants from Italy and close the country’s borders to most new arrivals.

The murder in Macerata last week of 18-year-old Pamela Mastropietro drew national attention to the city of 43,000 and added fuel to the debate on migration. On Wednesday, her dismembered remains were found packed into two suitcases. A 29-year-old Nigerian man, Innocent Oseghale, was charged with her murder.

“What was this maggot still doing in Italy? He wasn’t fleeing war, he brought war to Italy,” Salvini wrote on Facebook on Thursday.

The suspect in Saturday’s shooting ran as a Northern League candidate last June for a seat on the municipal council of Corridonia, a town of 15,000 people just south of Macerata, according to a Northern League spokeswoman, who spoke on condition that her name not be used.

“Violence is never the solution, violence must always be condemned. And those who are wrong need to pay,” Salvini wrote on Facebook on Saturday after the Northern League connection to the attack became clear. “Out-of-control migration brings chaos, rage, social clashes. Out-of-control migration brings drug-dealing, rapes, thefts and violence.”

He did not further address the alleged assailant’s connections to his party.

During the campaign, Salvini visited Corridonia and met with local candidates, according to the town’s center-left mayor, Paolo Cartechini, although it was not immediately clear whether the suspected shooter was present. The mayor said in an interview that last year’s campaign focused on the same issues that were being debated nationally, including immigration, but that the Northern League politicians did not use violent rhetoric.

One of Traini’s longtime acquaintances said the suspect gradually radicalized over at least six years. Traini would openly give the stiff-armed fascist salute and complain about African immigrants in the town, using a highly offensive term for them, said Francesco Clerico, who owns the gym where Traini trained for a decade. Clerico said the 28-year-old was stripped of his gym membership in October because of his views.

“It was very hard for him to relate to others,” Clerico said. “More than a criminal, he’s an individual with psychological problems.”

Asked about the shootings at a news conference earlier Saturday, before it became clear that a former Northern League candidate was the suspect, Salvini said that “whoever shoots is a criminal, no matter the skin color,” adding that “uncontrolled” migration leads to clashes, according to Italy’s ANSA news agency.

The Northern League’s opponents seized on the killing as evidence that the right-wing party’s rhetoric was stirring violence and division within Italian society.

“What happened today in Macerata demonstrates that inciting hatred and excusing fascism, as Salvini does, has consequences,” said Laura Boldrini, the president of the lower house of Italian parliament and a member of the left-wing Free and Equal alliance of parties.

The mayor of Macerata said the city had been unsettled by Mastropietro’s slaying last week, which added to an already-tense discussion of migration.

“Everything that happened between the death of Pamela and today was fanning the flames of hate between people,” the mayor, Romano Carancini, of the center-left Democratic Party, said in an interview. “It could have caused individuals who might not be entirely balanced to commit crimes like this.”

Follow the Bangor Daily News on Facebook for the latest Maine news.