Hungary’s parliament has passed new legislation tightening asylum rules, and backed plans to erect a border fence to keep out migrants.
The new law allows the detention of migrants in temporary camps, speeding up of the asylum application review process and limiting the possibility for appeal.
The move was criticised by the UN and human rights groups.
Hungary has seen a rise in the number of migrants and asylum seekers in 2015.
The government says about 54,000 migrants have entered the country so far this year, compared with 43,000 people in 2014.
The new legislation was passed easily in a 151-41 vote on Monday, with the backing of the governing Fidesz party and the far-right Jobbik party.
“Hungary is confronted with the biggest surge of migrants in its history, its capacities are overloaded by 130%,” Interior Minister Sandor Pinter was quoted as saying by the AFP news agency before the vote.
Government spokesman Zoltan Kovacs told the BBC that from now on the Hungarian authorities would regard Serbia, Macedonia, Bulgaria and Greece as “safe” countries.
In practice this means that almost all asylum seekers who reach Hungary – a landlocked country – overland will be rejected, the BBC’s Nick Thorpe in Budapest reports.
He adds that most will not even get a chance to apply, because they would be stopped by the border fence, construction of which is expected to begin immediately.
The wall would run the length of the 175km (109 miles) border with Serbia.
The UN and human rights groups have criticised Hungary’s immigration proposals.
The regional representative of the UN High Commissioner for Refugees warned that the legislation would have devastating implications for thousands of people seeking safety in Hungary.