MOIN, Macedonia (Reuters) - Hundreds of migrants marched out of a Greek transit camp, hiked for hours along muddy paths and forded a rain-swollen river to get around a border fence and cross into Macedonia, where they were detained on Monday, authorities said.

Migrants wade across a river near the Greek-Macedonian border, west of the the village of Idomeni, Greece, March 14, 2016. REUTERS/Stoyan Nenov

A Macedonian police spokeswoman said the several hundred migrants who had crossed into Macedonia would be sent back to Greece. A Reuters photographer put the number who crossed as high as 2,000.

About 30 journalists, including a Reuters photographer, who followed the migrants were also detained, witnesses said.

Earlier, Macedonian police said three migrants - two men and a woman - had drowned crossing a river near the Greek border that had been swollen by heavy rain.

The crossing put the migrant issue back in the spotlight days before leaders from the European Union and Turkey are due to meet again to seal an agreement intended to keep migrants in Turkey from moving to Europe through Greece.

At least 12,000 people, including thousands of children, have been stranded in a sprawling tent city in northern Greece, their path to the EU blocked after Macedonia and other nations along the so-called Western Balkan route closed their borders.

On Monday, more than 1,000 migrants streamed out of the camp, searching for a way around the twin border fences Macedonia built to keep them out. A second group of migrants, many of them from war zones in Syria and Iraq, later followed them.

Heading west along muddy paths, the migrants, wrapped in coats and hats, carried their belongings in rucksacks and bags. Many were children, some walking, others riding in strollers. Some made victory signs as they walked.

When they reached a river, the migrants stretched a rope across it and formed a human chain to cross. They carried children across on their shoulders.

Slideshow ( 19 images )

Once over the river, the migrants walked along the border fence until they found the point where it ended in mountainous country. But after they crossed the border, Macedonian soldiers rounded them up and put the migrants in army trucks.

“We are taking measures to return the group to Greece,” the Macedonian police spokeswoman said.

Hungarian Foreign Minister Peter Szijjarto said Hungary was the EU country that had sent most police officers to help non-EU member Macedonia protect its border with Greece.

“Macedonia needs and deserves help and assistance from the European Union because actually they’ve been protecting the southern border of the European Union,” he told reporters in Brussels.

Petros Tanos, a police spokesman in northern Greece, said police were investigating media reports that leaflets had circulated in the Idomeni camp urging migrants to march on Monday.

“We do not know who produced it...nor how they found the ropes yet,” he told Reuters, referring to ropes used to cross the river.

Babar Baloch, regional spokesman for U.N. refugee agency UNHCR, said conditions in the Idomeni camp were difficult after days of heavy rain.

“This is not a proper camp. People are exhausted, tired and running out of patience,” he said.

A Serbian customs spokeswoman said 33 migrants trying to cross into Serbia from Macedonia had been found in an empty cargo train in Presevo, southern Serbia, on Saturday and had been handed over to police.

The group, aged between 18 and 26, were mainly Afghans, but also included Syrians and Libyans. All but one were men. More than a million people fleeing war and poverty in the Middle East and beyond have flooded into the EU since early 2015.

In Berlin, German Chancellor Angela Merkel said on Monday there was no question Germany has benefited from the closure of the Balkan migrant route. A day earlier, voters in three regional elections had punished her conservatives and flocked to a new anti-immigration party that wants German borders closed.

But Italian Prime Minister Matteo Renzi said it was time to say enough to the selfishness of countries that thought raising a wall was a lasting response to the migrant challenge. “How long do you think a wall might last in the internet age?” Renzi told students in Rome.