A woman migrant with a baby passes through as police officers secure the railway tracks before a train that would take the migrants towards Serbia enters the railway station in the southern Macedonian town of Gevgelija.
Gevgelija, Macedonia - More than 5,000 migrants are heading towards Hungary, which is building a razor wire fence on its frontier to prevent them from entering.
Thousands of beleaguered migrants - mostly Syrians, Iraqis and Afghans fleeing bloody conflicts - crammed into trains and buses in Macedonia that brought them one step closer to the European Union on Sunday, a day after they stormed past police trying to block them from entering the country from Greece.
On Saturday, some 2,000 rain-soaked migrants rushed past baton-wielding Macedonian officers, who had been sealing the border for three days. Police fired stun grenades and dozens of people were injured as the migrants leapt over barbed wire or ran across a field not protected by the fence to enter Macedonia.
After the incident, police decided to allow migrants to cross the border freely again from Greece, which is also overwhelmed by the human tide. Police officials said that the blockade was imposed to try and stem the overflow of people that had caused chaotic scenes at a railway station in the Macedonian town of Gevgelija as thousands tried to secure places on overcrowded trains.
On Sunday, the migrants - many with children and babies - orderly boarded trains and buses that took them to the border with Serbia before heading farther north toward EU-member Hungary, which is building a razor wire fence on its frontier to prevent them from entering. If they manage to enter Hungary, the migrants could travel freely across the borders of most of the 28 EU-member states.
The more than 5,000 migrants who reached Serbia overnight faced an overcrowded refugee centre where they have to apply for asylum - the paper that allows them three days to reach Hungary. State Serbian TV said that a woman gave birth overnight inside the centre and that many people are sick and injured from Saturday's clashes.
"A huge number of people have arrived and we expect the same intensity in the next day or two," said Serbian Defence Minister Bratislav Gasic, who toured the area on Sunday.
Emina, a migrant from Syria who boarded an early morning train with her two-month-old baby, blamed Macedonian authorities for "harassing" the migrants, not giving them food or water, as well as holding them back at the border.
"It was very hard in Macedonia," she said. "I did not sleep or eat for three days. Just as we arrived to the border, they closed it. It was awful."
Both Greece and Macedonia have seen an unprecedented wave of migrants this year. More than 160,000 have arrived so far in Greece, mostly crossing in inflatable dinghies from the nearby Turkish coast - an influx that has overwhelmed Greek authorities and the country's small Aegean islands. Some 45,000 crossed through Macedonia over the past two months.
Few, if any, want to remain in Greece, which is in the grip of a financial crisis, or impoverished Macedonia. Most of the migrants who enter from Greece want to head straight to Macedonia's northern border and then north through Serbia and Hungary on their way to more prosperous EU countries such as Germany, the Netherlands or Sweden.
Separately, Italy's coast guard said it coordinated the rescue of some 4,400 migrants off Libya's coast on Saturday, the largest number so far in a single day.
The coast guard said 22 rescue operations were carried out for motorised rubber dinghies and fishing boats, all crammed with migrants desperate to reach Europe's southern shores.
So far this year, some 110,000 migrants have been rescued off Libya and brought to southern Italian ports. On Sunday, the Italian coast guard said it had asked three cargo ships to help in rescues, as more smuggler ships needed assistance.
A migrant sleeps at the train station in Gevgelija, Macedonia.