Hungary fence migrants
Soldiers building a barbed wire fence at the Hungary-Croatia border Reuters

Hungary's parliament has approved a controversial law that authorises the wider use of the military to fence off migrants gathering on its borders. The legislation allows the army to use non-lethal weapons such as rubber bullets, pyrotechnical devices, tear gas grenades and net guns, according to a statement published on the Hungarian parliament's website.

Predictably, the far-right Jobbik party voted with the right-wing Fidesz party of prime minister Viktor Orban in the ballot. The law passed with 151 votes to 12 against and 27 abstains in the 199-strong parliament.

Defending the measure, Orban said Eastern European nations have to protect themselves from the "brutal threat" of mass migration into their countries, until the EU organises a communitarian response to the refugee crisis.

"The migrants are not just banging on our door: they're breaking it down," he said. "It is our historical and moral obligation to defend Europe. Europe is rich but weak."

The tough measure is just the latest in a series of controversial bids to stop an influx of desperate migrants into the country. Last week, Hungarian police started to build a 25-mile razor wire fence on the border with Croatia, armed by hundreds of troops. "We must implement the same measures as on the Serbian-Hungarian border," Orban said in reference to the 10-ft fence built on the country's frontier with Serbia that diverted the flow of migrants towards Croatia and Slovenia.

On Monday, Hungary took out a full-page ad in a Lebanese newspaper to deter refugees from setting off for Europe. "Hungarians are hospitable but the strongest possible action is taken against those who attempt to enter Hungary illegally," the message read. "Do not listen to the people smugglers. Hungary will not allow illegal immigrants to cross its territory."

Under new regulations entered into force last week, migrants and refugees entering the country illegally or damaging its hastily erected border fences face a possible three-year jail term. Such sentences also carry a further burden for refugees, providing them with a criminal record that would hamper their chances of securing asylum in another EU country.

Meanwhile, a series of high-profile meetings to discuss the crisis at EU level are due to take place this week. EU interior ministers are scheduled to hold talks on 23 September, while an extraordinary summit of EU leaders is planned for the next day.

More than 430,000 migrants have arrived in Europe since January, according to the International Organisation for Migration (IOM). Most have crossed from Turkey to Greece and then proceeded north through the Balkans.