Up to 1,000 protesters have clashed with police in eastern Germany in riots reportedly sparked by the arrival of 250 migrants.

Police said protesters shouting "foreigners out" and carrying banners against the "asylum flood" threw bottles and stones at busloads of asylum seekers arriving in Heidenau, near Dresden.

At least 31 officers were hurt in violent scuffles as police used tear gas to disperse crowds.

Peaceful demonstrations began after news spread that the town was welcoming a large number of refugees who are set to be housed in an empty building.

"After the riots, the situation is now calm," a police spokesman told Tagesspiegel online, adding it was not yet clear how many people had been injured or how many arrests had been made.

Justice Minister Heiko Maas condemned the riots on Twitter saying that Germany will "never tolerate that people are threatened and attacked in our country."