Soldiers in Macedonia began erecting a metal fence on Saturday on the country's southern border with Greece, described by an official as a "preventive" measure to better control the flow of migrants across the Balkans, Reuters reported . Soldiers drove metal poles around three metres 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 en route to western Europe this year. Syrians, Afghans and Iraqis are flowing largely unimpeded across Balkan borders having landed by boat in Greece from Turkey. But for the past two weeks, countries on the route including Macedonia have begun turning back migrants of other nationalities, leading to a chaotic buildup at the Macedonian-Greek border and days of protests by Iranians, Pakistanis, Moroccans and others. Two days ago, protesters tried to storm police lines, breaking through a flimsy barrier into Macedonia, an impoverished former Yugoslav republic. A senior Macedonian government official, who declined to be named, said the new fence was "just a preventive measure." "We are not closing the border completely," the official said, describing it as an attempt to funnel the flow. "We will still allow the migrants from war-affected countries to pass."