Police in Macedonia fired tear gas and stun grenades at migrants demanding passage through the country to Western Europe today as soldiers began erecting a metal fence to keep them out.

The violence broke out after one migrant, believed to be Moroccan, suffered an electric shock and was badly burned when he climbed on top of a train wagon on the Greek-Macedonian border.

An angry crowd, stranded on the border for days after Macedonia barred passage to all but Syrians, Iraqis and Afghans, surged towards lines of Macedonian police and began throwing stones.

The police responded with tear gas and stun grenades, driving the crowd back.

It was the latest clash since Macedonia and other Balkan countries on the migrant route began filtering refugees almost two weeks ago, turning back those deemed "economic migrants".

Human rights organizations have criticized the move, saying international conventions require countries to treat asylum requests on merit, not on the basis of nationality.

Some Iranians on the Greek-Macedonian border have sewn their lips shut and are refusing food.

One man appeared to break down, throwing himself on railway lines before the Macedonian police, screaming and flailing.

Syrians, Afghans and Iraqis fleeing conflict are flowing largely unimpeded across Balkan borders having landed by boat in Greece from Turkey.

But the new measures have led to a chaotic build-up at the Macedonian-Greek border and days of protests by Iranians, Pakistanis, Moroccans and others.

Earlier on Saturday, Macedonian soldiers began driving metal poles around 3 meters high into the cold, muddy ground, building a barrier similar to that erected by Hungary on its southern border to keep out the hundreds of thousands of migrants who have crossed the Balkans this year.

The government said it was moving ahead with plans to build a fence but had no intention of closing the border completely.

European Union member Hungary in September and October sealed its own southern border to migrants, calling them a threat to the security, prosperity and "Christian values" of Europe.

That diverted them into Croatia and Slovenia en route mostly to Germany, which is struggling to cope. Germany expects roughly 1 million refugees and migrants to arrive this year alone.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.