A German court's ruling that the police can check an individual's ID on the basis of skin color has drawn severe backlash from the black community, which likened the court decision to institutionalized racism.

The administrative court of Koblenz in western Germany dismissed a complaint by a black German who was asked to show his documents while on board a train, German media reported.

He was taken to the police station after he refused to produce his ID for police verification. The two federal police officers who questioned the man filed a complaint in the court alleging that the black man abused them in the process.

One of the officers said he checked the ID of train passengers if he considered them foreign citizens based on their appearance and skin color.

This argument prompted the black man in question to sue the officers, alleging illegal conduct. However, judges ruled on Tuesday that the police officers didn't violate the law and were guided by their border policing experience.

The judges observed that the train on which the incident happened was operating on a route notorious for illegal entry into Germany, justifying the officer's argument to chose people for checking on the basis of skin color.

The black community in Germany has slammed the court decision, saying that the ruling is illegal. If this is true, it is essentially illegal, Tahir Della of the Initiative of Black People in Germany (ISD) told The Local. The authorities have always said the police do not do racial profiling.

Non-white people already get a disproportionate amount of hassle from the police, if this is now being officially sanctioned, then it will open the floodgates, he added. I am of course very shocked by this. It is basically racism.