Hungary's Prime Minister Viktor Orban has warned that people who cross the country's border illegally will be arrested from next week.
Mr Orban said refugees or migrants entering Hungary in their thousands in the past weeks had "rebelled" against his police force, and order had to be restored.
Aid workers have been telling of "abysmal" conditions for refugees at a camp on the Hungarian-Serbian border.
Video footage has emerged of people being thrown bags of food at the camp in the town of Roszke, and one volunteer said people were being kept in cages.
Hungary has struggled to cope with some 150,000 refugees that have crossed its borders so far this year, en route from Greece to countries in northern and western Europe.
There have been tensions between the authorities and refugees, at border areas and key railway stations.
Hungary has insisted it was trying to fulfil its obligations as an EU member and register all new arrivals, but its attempts to control the flow - such as building a fence along its border with Serbia and staging border protection exercises - have proved controversial.
Mr Orban has now warned that tougher immigration laws would take effect from September 15 and anyone crossing the border illegally could expect to be arrested.
He praised the police for doing a "remarkable" job "without force" in the face of unco-operative refugees or migrants who, he said, had "rebelled against Hungarian legal order".
A key point of tension in Hungary had been at a refugee reception centre in Roszke, where the authorities had been taking many refugees newly arrived from Serbia.
Scenes from inside the camp were revealed in video footage filmed by Michaela Spritzendorfer, the wife of an Austrian Green party politician who was delivering aid to the camp, and Klaus Kufner, a journalist and activist.
Ms Spritzendorfer said police were throwing plastic bags containing food to around 100 people, including the elderly and the very young.
"These people have been on a terrible tour for three months," she said.
"Most of them have been across the sea now and on the boat and through the forest and they've gone through terrible things and we, as Europe, we keep them there in camps like animals."
Another aid worker, Irish volunteer Patrick Quirke, said people were being kept in padlocked wire cages, guard dogs were running free and "from what I was told the food is very sparse, the conditions are cold, the children were cold and they weren't being provided with any heating".
He said children were suffering particularly hard - and police dogs were roaming the camp unleashed and unmuzzled.
Human Rights Watch said refugees were being kept in "abysmal" conditions at two detention centres in Roszke, lacking food and medical care. The group quoted two refugees who described the conditions as only fit for animals.
Hungarian police have said they will investigate the scenes from inside the camp.
Austria 'overburdened' by influx
Austria has partially shut a motorway linking Vienna and Hungary as hundreds of refugees who had crossed the border set off for the Austrian capital on foot rather than wait for authorities to arrange transport.
Austria says it has closed the A4 motorway near the Hungarian border for security reasons.
Around 12,000 people have crossed the border into Austria in the past 24 hours and more are expected.
Austria also cut its rail link to Hungary yesterday, citing a "massive overburdening" of its capacity by mainly-Syrian refugees who continue to stream in from Hungary.
The train line will remain closed over the weekend.
Germany expects 40,000 refugees this weekend
The International Organisation for Migration said almost 433,000 refugees and migrants have crossed the Mediterranean so far this year - more than double the total for last year.
Germany's Foreign Minister, Frank-Walter Steinmeier, said he was expecting about 40,000 refugees to enter Germany this weekend alone.
Frank-Walter Steinmeier said 4000 troops would be put on stand-by to help with any emergencies this weekend.