The European Union's migration commissioner said on Thursday that barriers of the kind that Hungary had erected on its Serbian border were temporary solutions that only diverted refugees and migrants to other countries and escalated tensions.
Hungary on Wednesday detained 29 people as migrants demanding to be let through its newly-shut EU frontier clashed with riot police firing water cannon and tear gas.
"The majority of people arriving in Europe are Syrians in need of our help," Dimitris Avramopoulos told a joint news conference with Hungary's foreign and interior ministers.
"There is no wall you would not climb, no sea you would not cross if you are fleeing violence and terror," he said. "We have a moral duty to offer them protection."
Avramopoulos urged Hungary to continue to work with the EU Commission to find common and lasting solutions, adding that violence was not the answer.
Hungary is planning to extend its security fence towards Romania and parts of the Croatian border in a measure that it says is necessary to protect the European Union's external frontier and its border-free Schengen zone.
United Nations Secretary-General Ban Ki-moon has expressed shock and alarm at the treatment of refugees and migrants on the border of Hungary and Serbia, warning that they should be treated with dignity and their human rights respected.
But Hungarian Foreign Minister Peter Szijjarto lashed out at those criticising Hungary's handling of the clashes.
"It is bizarre and shocking how some members of international political life and the international press interpreted yesterday's events," Szijjarto said, without naming anyone specifically.
He said that, by siding with rioting migrants pelting Hungarian police with rocks in clashes that left 20 police injured, some "respected members" of international politics only encouraged violence.
"All these people will be responsible if these events are repeated today, tomorrow or the day after tomorrow," he said.
Szijjarto said the European Union's common refugee policy had failed to tackle the crisis, which has seen hundreds of thousands of people fleeing poverty, war and persecution in the Middle East, Asia and Africa pour into the continent.
"We are probably seeing a protracted wave of migration that has endless reserves," Szijjarto said, proposing two measures that Budapest says could tackle the root causes of the crisis.
He said the EU should establish a common force without delay to protect Greece's borders, to which Hungary would provide a "massive national contribution" in the form of police, money and soldiers.
"Quotas should be applied here, because here quotas make sense," he said, adding that Hungary also proposed that the EU should take charge of financing refugee camps in Turkey, Jordan, Lebanon and Iraq and build new camps there if necessary.