Police in Germany have dismissed accusations of racial profiling in the city of Cologne, where they detained hundreds of North African refugees during New Year festivities.

Cologne Police Chief Juergen Mathies defended the detentions on Sunday, saying they were part of an effort to prevent a repeat of sexual assaults and robberies that happened in the city last year.

Assaults on hundreds of women in 2016 were blamed mainly on male North African refugees.

Late Saturday night, Cologne police tweeted a message and described a group of men seeking to use the city’s main train station en route to the city center as being “seemingly of African descent.” They detained and screened around 650 men for identity checks. It was not clear how many of them were ultimately allowed into the city.

The move prompted online criticism against police.

Mathies, the chief of Cologne police, rejected the “negative criticism.”

“This was clearly about preventing similar incidents to last year,” he said at a news conference. “Their characteristics were such that potential crimes could indeed be expected.”

Police talk to people at Cologne’s main train station, December 31, 2016. (Photo by AFP)

Apart from the Africans detained and screened, some 92 other people — including 16 Germans and 10 Syrians — were arrested during the Saturday night celebrations.

The sexual assaults in Cologne last year helped fuel the rise of anti-refugee groups, who seized on the attacks to criticize Berlin’s open-door policy toward refugees and to put pressure on the government of Chancellor Angela Merkel to change course.

Germany is one of the European countries that have been receiving high numbers of refugees, who are mostly fleeing conflict-ridden zones in North Africa and the Middle East, particularly Syria.

More than one million asylum seekers arrived in Germany over the past two years.