IDOMENI, Greece (Reuters) - Greek police rounded up some 2,300 migrants who had been stranded for three weeks at the border with Macedonia and transported them to Athens on Wednesday, dashing their hopes of seeking asylum in northern Europe.

Greek police officers direct buses carrying hundreds of migrants, who were stranded on the Greek-Macedonian border and blocked rail traffic, after a police operation near the village of Idomeni, Greece, December 9, 2015. REUTERS/Alexandros Avramidis

Scuffles broke out but not on the scale of recent clashes between police and the migrants, who are mostly from Pakistan, Morocco, Algeria and Somalia. They have been encamped in squalid, freezing conditions near the town of Idomeni after Macedonia began filtering migrants by nationality on Nov. 19.

Some 350 police were involved in transferring them, out of sight of media cameras, on 45 buses to an indoor sports stadium in Athens used for taekwondo during the 2004 Olympic Games and to disused premises at the former Athens airport of Hellinikon.

A police official said the migrants had been given 30 days to leave the country but were not in detention. If they are caught in Greece after the deadline expires, they will be arrested and deported.

However several of their home states do not have readmission agreements with Greece. Last week Pakistan refused to take back some migrants flown home from Athens by the EU border agency Frontex.

At Idomeni, some 30 men initially resisted being herded onto the buses and were taken to a police station near the border but were later put on Athens-bound buses as well.

At least three foreign journalists and photographers were briefly detained to prevent them watching the police operation, a Reuters photographer said.

Slideshow ( 4 images )

Police said in a statement the journalists had been kept away “to protect them from any possible violence, tension or threatening and aggressive behaviour”.

At the other end of the country, 12 migrants drowned when their boat sank off the small Greek island of Farmakonisi, close to Turkey, in the early hours of Wednesday, a coastguard official said, while 26 were rescued and 12 more were missing.

The U.N. refugee agency said those rescued included a seven-year-old child whose parents were both missing. Six other children were among those who drowned.

PERILOUS CROSSING

Migrants continue to attempt the perilous crossing despite the onset of winter weather, mounting obstacles in Europe and increased efforts by Turkey to crack down on people smugglers.

Hundreds of thousands of people have streamed into Europe this year, mostly through Greece. Balkan states began blocking passage last month to all but Syrians, Iraqis and Afghans, who are considered as refugees because they are fleeing war zones.

Some of those stranded near Idomeni began hunger strikes and a handful sewed their lips shut to dramatise their demands. A Moroccan was electrocuted to death last week on a railway line which migrants had been blocking. Another was seriously burnt when he climbed on top of a train to try to cross the border.

Macedonia has erected a metal fence to keep unwanted migrants out and plans to extend it to cover more than 40 km (25 miles) of the border.

More than 600,000 people have arrived in Greece this year, making the short but perilous journey by boat or rubber dinghy from Turkey to outlying islands. Thousands more have drowned.

Turkey has vowed to do more to stop the flow after signing a deal with the European Union on Nov. 29 under which it will receive 3 billion euros ($3.3 billion) in aid to improve conditions for the 2.2 million Syrians Ankara has been hosting.