The Hungarian parliament has passed a law authorizing the government to deploy the military to help handle the asylum seeker crisis in the country, which includes powers to use non-lethal force.
According to the law, the army would be allowed to use rubber bullets, pyrotechnical devices, tear gas grenades or net guns, the parliament's website said.
The legislation passed with 151 votes in the 199-member parliament, with 12 against and 27 abstentions.
The ruling center right Fidesz party of Prime Minister Viktor Orban was supported in the vote by radical nationalist Jobbik party, which previously sought even tougher measures.
On Saturday, Hungary completed construction of a 41-kilometer fence on its border with Croatia, which is the source of the refugee and migrants flow.
Budapest also accused Zagreb of violating Hungarian sovereignty after Croatia allowed a train carrying a thousand asylum seekers into the country.
Europe has been facing an ever-toughening crisis since the spring. Hundreds of thousands of refugees and migrants from Syria, Iraq and Afghanistan have fled their homes in search of better security and life prospects.
The migrants and refugees are using Eastern European countries, such as Hungary, Serbia and Croatia, as transit routes to Germany, with local authorities having serious problems processing the deluge of people.
All in all, over 300,000 asylum seekers have crossed the Mediterranean Sea since the beginning of the year, according to the UN, with the figures expected to reach over 850,000 people in 2016.