Hungarian police have used tear gas and water cannon on hundreds of refugees who broke through a razor wire fence on the border with Serbia.
Frustrated people blocked on the Serbian side of the border threw plastic water bottles at rows of helmeted riot police and chanted demands that the border be re-opened. Police responded with tear gas but there were no apparent injuries.
Some women pushed to the front of the crowd and held small babies and children above their heads as they faced police in an obvious appeal for mercy, but no one made it through.
The incident took place at a small border crossing in Horgos, a short distance from the main border crossing into Hungary.
Hungarian authorities also said that they have arrested a total of 519 migrants who tried to cross the border since tough new laws went into effect on Tuesday that make it a crime to cross from Serbia anywhere other than at legal checkpoints.
Authorities launched 46 criminal prosecutions and found an Iraqi man guilty, the first conviction based on the new laws. Hungarian media reported the judge ordered the man be expelled from Hungary and banned him from returning for one year. It was expected that he would be returned to Serbia.
Televised images from a courthouse in Szeged earlier showed four Iraqi men who were charged with their hands tied in front of them and their shoelaces removed ahead of trial.
Hungary's foreign minister denied that closed borders and tough new laws signal callousness toward refugees, repeating the government's claim that most of those entering Hungary are actually economic migrants.
"Based on our history, we are always in solidarity with the refugees," Peter Szijjarto said in an interview. "What we're saying is that we cannot accept economic migrants because we cannot bear the burden of that." Most of the people who had hoped to cross into Hungary were still trapped along the border in Horgos, Serbia, however.
Many were confused about whether to keep waiting or to try to enter the EU through Croatia, a longer and less direct path into Western Europe.
Melita Sunjic, a spokeswoman for the UN refugee agency, said that early in the day the migrants were refusing to leave the border but changed their minds because of news and rumours going around that Croatia's borders were open.
Most hope to reach Germany, where Chancellor Angela Merkel's government has said it expects some 800,000 refugees to arrive in Germany this year alone. The vice chancellor has said the number could even reach one million.
Croatian Prime Minister Zoran Milanovic criticised Hungary's decision to seal its border and said Croatia will not do the same.
Elsewhere in Europe, refugees remained on the move. Greek police said about 5,000 crossed the country's northern border with Macedonia in the 24 hours on Tuesday. Meanwhile, Austria began selective controls of vehicles at three main border crossings with Hungary.