Mr Ban said such treatment of asylum seekers was “unacceptable”.Hundreds were involved in clashes at the Hungary-Serbia border on Wednesday, trying to breach a razor-wire fence.
More than 5,000 migrants have entered Croatia so far – avoiding Hungary – police say, and another 7,266 entered Germany on Wednesday.
German police said this was more than double the number that crossed the previous day, adding that most were picked up on the border with Austria.
Germany is the final goal of many migrants, as the European Union remains divided over how to deal with the crisis.
What is the next route through Europe?
Migrants warned of landmines
Tripped migrant father gets Spanish job
Migrant crisis eclipses Greek election
Hungary defended its action, saying that 20 police officers were injured as migrants tried to break through a gate, and a spokesman accused migrants of using children as “human shields”.
At least two migrants were also injured, Hungarian and Serbian officials said.