Hundreds of migrants are stranded at the Serbia-Hungary border after the Hungarian government closed the frontier with a new razor-wire fence.
The move aims to stop migrants who are trying to enter the EU.
After new Hungarian laws came into effect overnight, police sealed a railway crossing point that had been used by tens of thousands of migrants.
Some have been searching for a way through the fence, while others threw down food and water in protest.
Hungarian Foreign Minister Peter Szijjarto has suggested his country is planning to build a fence to keep migrants out along part of its border with Romania - a fellow EU member - to prevent the bypassing of the current frontier.
The EU is facing a huge influx of migrants, many fleeing conflict and poverty in countries including Syria, where a civil war has been raging since 2011.
The EU's border agency says more than 500,000 migrants have arrived at the EU's borders this year, compared with 280,000 in 2014. The vast majority have come by boat across the Mediterranean.
A Serbian government minister, Aleksandar Vulin, argued that the closure of the border by Hungary was unsustainable. "They will have to open the border," he insisted.
In other overnight developments twenty-two people, including four children, drowned after a wooden boat following the most popular recent migrant route, between Turkey and Greece, sank; and 179 refugees stepped off a Munich-Berlin train in Saxony after the emergency brake cord was pulled.
Hungary declared a state of emergency in two southern counties as the new laws came into force.
Anyone who crosses the border illegally will face charges, and 30 judges have been put on standby to try offenders.
The laws also make it a criminal offence - punishable by prison or deportation - to damage the newly built 4m razor-wire fence along Hungary's 175km border with Serbia.
Police buses will now take asylum applicants to registration centres, but if their applications are refused they will now be returned to Serbia rather than being given passage through Hungary.
The state of emergency gives police extra powers and could allow the deployment of troops, if parliament approves.
Hungarian authorities said more than 9,000 people - a new record - crossed into the country on Monday before the border was closed. Some 20,000 crossed into Austria from Hungary.
Police said they had arrested 60 people accused of trying to breach the fence on the border with Serbia.
Hungarian government spokesman Zoltan Kovacs said: "The official and legal ways to come to Hungary and therefore to the European Union remain open. That's all we ask from all migrants - that they should comply with international and European law".
The European Commission said it was seeking clarification of parts of the new Hungarian legislation, to check whether it was in line with EU asylum rules.
Row over quotas
Starting on Tuesday, the EU has agreed to relocate 40,000 migrants from Greece and Italy to other EU states. But it has yet to agree on mandatory quotas for a further 120,000 asylum seekers.
At talks in Brussels on Monday, a majority of states had agreed in principle to the idea of relocating a further 120,000 through mandatory quotas, and there was hope the proposal could be finally approved at a meeting on 8 October.
Germany and Austria are calling for a special meeting of EU leaders next week to discuss the crisis.
German Chancellor Angela Merkel told a news conference that "this problem can only be solved together. It is a responsibility for the entire European Union".
However, the Czech Republic, Slovakia and Hungary have opposed the quotas.
German Interior Minister Thomas de Maiziere said on Tuesday there should be ways of "exerting pressure" on states that refused binding quotas, possibly by reducing the amount of EU funding they receive.
But the Czech state secretary for the EU, Toma Prouza, said such threats were "empty but very damaging to all"
A spokeswoman from the UN refugee agency, Melissa Fleming, said she expected migrant "chaos" to continue in the absence of more decisive action by the EU, with migrants seeking a new route.
Germany introduced temporary border controls on Monday. That slowed down the passage of migrants from Austria, where about 2,000 people slept in railway stations overnight.
Austria - one of several EU countries to say it would tighten border controls - is starting to deploy hundreds of troops to help the police deal with migrant arrivals ahead of the new measures coming in at midnight (22:00 GMT).
The moves are a challenge to the EU's Schengen agreement on free movement, although the rules do allow for temporary controls in emergencies.