Rioters hurled stones, bottles and fireworks at police and damaged 13 police vehicles as violence spun out of control in the western city of Mannheim. Authorities responded with pepper spray. There were 31 arrests.
Police said the violence was touched off when festival organisers tried to prevent a 14-year-old boy entering the grounds with the flag of a banned group.
As tempers rose, the organisers called the police, who were attacked on arrival. Thousands of festival-goers were involved in the violence late on Saturday, police said.
Authorities also seized four knives and a knuckle-duster.