German riot police officers take their positions near the Hauptbahnhof before New Year celebrations in Cologne, Germany, on Dec. 31, 2016. (Wolfgang Rattay/Reuters)

Police in the German city of Cologne were overwhelmed last year by a wave of sexual assaults on New Year’s Eve. This holiday, they deployed teams for preemptive sweeps.

The result set off the latest political clash at the intersection of Germany’s struggles over migration and security as authorities questioned hundreds of North African men. They took nearly 100 people into custody.

But was it a security operation or an exercise in mass racial profiling?

After the deadly Dec. 19 truck attack on a Berlin Christmas market by a suspected Tunisian man, Germany is more polarized than ever over how to deal with the hundreds of thousands of recently arrived asylum seekers, including many from the Middle East and North Africa.

The New Year’s sweeps in Cologne, about 300 miles southwest of Berlin, became the latest flash point, with police being both hailed and criticized for deploying newly aggressive tactics.

The divide illustrates the intensifying debate in Germany — and across Europe — about how to balance cherished values of privacy and civil liberties against a new era of risk. German authorities said Monday that they had made yet another terrorism-linked arrest, taking into custody a Syrian migrant suspected of seeking funds from the Islamic State to stage a truck bomb attack.

Over the weekend, police deployed thousands of officers in Cologne. Videos showed a large group of men, apparently North Africans, corralled for questioning. Critics blasted the police, in part for using a term for North Africans that some consider an ethnic slur.

“Hundreds of Nafris screened at main railway station,” the Cologne police tweeted on New Year’s Eve.

On Twitter, the popular German comedian Jan Böhmermann retorted, “What is the difference between Nafri and the [n-word]?”

Police say the term is simply a shorthand they use internally to refer to North Africans and is not derogatory.

Amnesty International denounced the police operation as blatant “racial profiling.”

“Questions over the legality and proportionality arise when nearly 1,000 people are checked and partially stopped only because of their appearance,” senior Green Party politician Simone Peter told the Rheinische Post.

Yet far more voices appeared to push back against the critics, crediting the police with taking measures to prevent a repeat of last year’s violent New Year’s Eve — when more than 1,200 women were sexually assaulted in various German cities, including more than 600 in Cologne and about 400 in Hamburg.

More than 2,000 men were allegedly involved. At least 120 suspects — about half of them foreign nationals who had recently arrived in Germany — have since been identified.

The government of Chancellor Angela Merkel — under fire over her former open-door policy toward refugees — backed the Cologne crackdown.

“The government is very relieved that the public New Year's Eve festivities proceeded mostly peacefully and, above all, without such dreadful incidents like last year,” government spokesman Georg Streiter said Tuesday.

Sigmar Gabriel, chairman of the Social Democratic Party and Germany’s vice chancellor, told the Funke newspaper group that criticism directed at the police operation was unjustified.

It “has nothing to do with racism but with smart public safety,” he said Monday. Gabriel also defended use of the term “Nafris.”

“What else should the police do apart from stopping exactly that group of North Africans and preventing them from accessing Cologne’s inner city?” he asked.

Even Peter, the Green Party official, softened her tone as party colleagues appeared to distance themselves from her earlier remarks against the police operation.

“That the people of Cologne were able to celebrate more peacefully this year and that the assaults which happened last year did not repeat is thanks to the well-prepared police,” she wrote.

Cologne’s police president, Jürgen Mathies, claimed Monday that suspects were screened based on “aggressive” behavior rather than appearance. He said a large number of men had suddenly turned up at Cologne’s central train station on New Year’s Eve, leading authorities to send in reinforcements.

Ultimately, police detained 92 people — including 16 Germans and 10 Syrians — on Saturday night in Cologne.

“I feared that the [situation] could suddenly sour,” Mathies said.

Nevertheless, he said he regretted the use of the word “Nafris” in a police tweet.

“This term is not supposed to be used for public relations,” he said. He added that the term had been in use internally since 2013 to describe young North African men “who have distinguished themselves for years with a particular willingness to use violence.”

On Tuesday, Interior Minister Thomas de Maizière, in a piece for the Frankfurter Allgemeine Zeitung, called for new steps on deportations. They included the creation of “federal departure centers,” in which rejected asylum seekers could be kept before their deportations to prevent them from slipping away or going into hiding.

Noack reported from London.