Police said that 17 people were arrested during the course of the day, while 45 were injured - 44 of them police officers.
Organizers had originally given notice of a 1,500-strong protest march against Islamic fundamentalism to the police under the banner of the group “Hooligans against Salafists”.
But more than 4,000 people showed up, some having travelled hundreds of kilometres to be there and many of them looking for a fight.
As they arrived at the central station, shouts of “foreigners out” could already be heard.
GALLERY: Police battle thugs in Cologne
After gathering at Breslauer Platz at around 3pm, the marchers began letting off pyrotechnics in the direction of police and throwing bottles and stones.
“Demonstrators attacked the police in massive numbers,” a spokesman said. “We used pepper spray, truncheons and water cannon to get the situation under control quickly.”
Police had to deploy around 1,000 officers to contain the hooligans, many of whom had been drinking heavily.
Violence broke out again later at the central station, which had been locked down by police, as the demonstrators attempted to break back in.
They threw chairs and bicycles at the officers and overturned a police van. The police responded again with water cannon.
Once the violence had been calmed, officers escorted the hooligans in small groups through the station to their trains to get them out of the city, although there were continuing small scuffles.
“There was a very high potential for violence,” the police spokesman said, “and a very aggressive feeling towards the police.”
"The police plan worked," North Rhine-Westphalia interior minister Ralf Jäger told broadcaster ZDF on Monday morning. "The demonstration was cancelled by the organizers. But the participants refused to leave the area."
North Rhine-Westphalia Police Union (GdP) president Arnold Plickert said that the anti-Islamic group threatened to bring “a new kind of violence” to Germany's streets if its numbers continued to grow which the police might not be able to control.
Head of the North Rhine-Westphalia Office for Constitutional Protection (Verfassungsschutz) Burkhard Freier told Westdeutsche Rundfunk that the demonstrators "consisted of different groups, hooligans up for a fight, with crossover into the right-wing scene... NPD, the Right Party, but also skinheads and the [far-right] music scene."
The demonstration had brought together hooligan groups which more usually fight one another but had found common cause in their hatred of Islamic extremists, Freier said.
Just a few weeks ago “Hooligans against Salafists” were only able to gather a few dozen supporters at demonstrations in Mannheim and Essen.
Story continues below…
But in early October, 300 gathered in Dortmund after the ranks were swelled thanks to recruitment on social networks.
By Monday morning the group's Facebook page, which had been a focus for its organizing, had been removed.
The group has combined with far-right organizations such as North Rhine Westphalia anti-Islamic party Pro NRW, which gave the police notice of the demonstration on Sunday.
Pro NRW is under surveillance by the security services.
A counter-demonstration by around 500 people who gathered at the station before marching to Friesenplatz passed off peacefully.
SEE ALSO: Refugees beaten up in Hamburg