Riot police used water cannons and tear gas in a tense faceoff with an estimated 1,700 anti-immigrant protesters outside the main train station in Cologne, Germany.
The assembled crowd had been demanding much tougher laws on refugees after a string of New Year's Eve sexual assaults and robberies in the city blamed largely on foreigners.
Some protesters threw firecrackers and beer bottles at officers before the rally was shut down, according to a Reuters witness.
Four people were taken into custody but there no injuries were immediately reported, police said.
A police spokeswoman said the anti-immigrant protest had attracted some 1,700 people, half of whom she described as coming from the "hooligan scene."
Police had called on demonstrators, some of whom had chanted that German Chancellor Angela "Merkel must go," to return to a square near the city's train station, from where they had set out on a march through Cologne.
The protesters "had separated from a second protest — a counter protest — organized by various left wing groups," CBC's Dominic Valitis reported from London on Saturday, describing it as "a pretty challenging situation for police."
"The police in Cologne have been under a lot of pressure to perform after the events of New Year's Eve," said Lucian Kim, a freelance journalist in Berlin. On Friday Cologne's police chief Wolfgang Albers was fired amid criticism of his force's handling of those events.
The anti-Islam protesters on Saturday were from the group PEGIDA, which stands for Patriotic Europeans Against the Islamization of the West. The group says that immigration and national identity are issues neglected by German politicians.
The reports of the attacks on women by groups of men described by police as predominantly Arab or North African in origin have fuelled calls for tighter controls in Germany, which received nearly 1.1 million migrants in 2015.
Also Saturday, Merkel's Christian Democrats agreed on a proposal to strengthen the ability of police to conduct checks of identity papers, the dpa news agency reported.
As well, the party at a meeting in Mainz, also agreed to exclude foreigners from being granted asylum who had been convicted of crimes and sentenced to terms even as light as probation.
"This is in the interests of the citizens of Germany, but also in the interests of the great majority of the refugees who are here," Merkel said.
The proposal would need parliamentary approval.