Pushing and shoving each other, hundreds of migrants trying to get to Serbia overflowed the train platforms of this southern Macedonian town, near the border with Greece, on Saturday.

The migrants, mostly from the Middle East but also from Afghanistan, want to arrive in Serbia, the last country that stands between them and a European Union member state, Hungary.

The route partly avoids deadly boat crossings in the Mediterranean and is becoming increasingly popular among migrants desperate to gain asylum in Europe. Migrants either travel from Turkey to Greece by boat, or to Bulgaria by land, and from there on they move to Macedonia and Serbia. Along the way, they often fall prey to people smugglers and criminal gangs.

The migrants have taken to the trains because they are the cheapest mode of transport and because they save the money they would normally hand over to smugglers, who bundle as many as possible into cars and trucks, sometimes with fatal results.

Chaotic scenes ensued at Gevgelija railway station as the migrants try to secure a place onboard the train that will take them to the border with Serbia. Tempers flared at the ticket booths and the platform. Those who had not secured platform space early, or who had sought shelter from the blazing sun in idle cargo wagons, darted in front of the oncoming train, some with children in tow, to gain a foothold.

Soon the train, packed through the rafters with people, departed the station. But many were left on the platform, waiting for the next train.

Macedonian authorities provide 3-day transit visas so that migrants are not left stranded in the country. But it is up to the migrants to make the border crossing by whatever means.

The migrants' urgency to reach Europe has become more pronounced as they race to reach Hungary before the Hungarian government finishes building a razor-wire fence.

Some 1,000 migrants per day were trying to cross before Hungary announced plans for the fence a few months ago.

That number has shot up to 1,500.