Violence erupted after about 20 refugees in the overcrowded shelter went in pursuit of another resident late on Wednesday, accusing him of ripping pages out of a Koran and throwing them in a toilet, local police said.
The Afghan man was eventually saved by the shelter's guards as well as police, prompting the mob – according to local media mainly Syrian men – to turn their anger on the security forces.
About 50 people armed with steel rods began throwing stones at the officers, leaving at least 17 people injured.
Windows were smashed, furniture flung out of windows and even dividing walls in the shelter hacked down in the rampage that lasted several hours in the town of Suhl in Thuringia.
Germany is struggling to accommodate a wave of asylum-seekers from warzones such as Syria but also migrants from countries that are not at war like Albania and Kosovo.
The sudden surge in asylum demands this year has left authorities scrambling to house the migrants, with schools and tents used as temporary shelter.
Local officials have repeatedly raised concerns of overcrowding, saying that they were unable to cope with the accelerating demand.
The refugee home in Suhl has a capacity for 1,200 people but is currently hosting 1,700.
Thuringia minister-president, Bodo Ramelow, told public broadcaster MDR that different ethnic groups should be separated in refugee homes in order to prevent such violence from erupting.
But the authorities were hamstrung by a lack of available shelter, he added.
“We need to expand our capacity urgently,” Ramelow stressed.
The GdP police union urged politicians to take rapid action to deal with the record numbers seeking refuge in Germany.
“The violence in Suhl should alarm the politicians. The overcrowded shelters, the agonising cramped conditions with hardly any room for privacy leads to conflicts for the tiniest things and could descend into violence,” said Jörg Radek, the deputy chief of the union, in a statement.
Europe's biggest economy has become the top destination for those fleeing war and persecution.
Berlin now expects to receive up 800,000 asylum-seekers this year – four times more than in 2014 – as the latest figures show numbers accelerating dramatically.