Austria has adopted one of Europe's toughest laws on refugees, days after a far-right politician surged to victory in the first round of a presidential election.
Under the terms of the new law, which the parliament passed by 98 to 67 on Wednesday, the government can declare a "state of emergency" if refugee numbers suddenly rise and reject most refugees directly at the border, including those from war-torn countries like Syria.
Rights groups, religious leaders and opposition parties have condemned the legislation - the latest in a string of hardline measures against refugees - as violating international human rights conventions.
"These are extremely dangerous tools that are being sharpened here, especially if they fall into the wrong hands," warned Mathias Strolz, the leader of the NEOS opposition party, before the vote.
The controversial bill comes just days after Norbert Hofer, a candidate of the far-right Freedom Party (FPOe), won the first round of a presidential ballot.
According to analysts, the FPOe is set to do well in the next scheduled general election in 2018.
Wedged between Europe's two main refugee routes - the Balkans and Italy, Austria received around 90,000 asylum requests in 2015, the second-highest in the bloc on a per capita basis.
After initially welcoming refugees, the government capped the number it would accept this year to 37,500. It has received more than 16,000 claims since the beginning of 2016.
Many brave a short but dangerous sea journey from Turkey to Greece, before trekking up through the Balkans towards western and northern Europe.
More than a million people, primarily from Syria, Iraq and Afghanistan, landed in Europe last year, triggering the continent's worst migration crisis since the aftermath of World War II.