“You have a violence problem that you haven't tackled,” the judge told the accused – whom he went on to call an “uncontrollable person” – while explaining the sentence for attempted grievous bodily harm and theft.
The man had previously admitted to throwing a heavy pipe at a line of police officers.
He narrowly missed the officers, but went on to join people looting a bakery and to throw a bottle at another policeman.
The accused said that he had an alcohol problem and was drunk at the time of the offences.
Around 5,000 self-described 'hooligans' and other far-right supporters came together in Cologne in October for a demonstration supposedly directed against Islamic fundementalist Salafists.
But the march descended into running street battles with the police, with rioters injuring dozens of officers before they could be removed from the city centre.