Macedonia has closed its border again overnight, after police earlier in the day fired tear gas and stun grenades to drive back refugees who were trying to cross its border from Greece.
An emergency decree that effectively sealed the Macedonian frontier swung back into action on Friday night, with authorities saying they would reopen the border at 5am on Saturday.
Al Jazeera's Ivan Corkalo, reporting from the Greek border town of Idomeni, said thousands of stranded refugees, many of whom had no food or water, were in for a second difficult night in no-man's land.
"As if they didn't already have enough of their own problems, just a few minutes ago, light rain started and the forecast for tonight is heavy rain," our correspondent said.
Priority for crossing the border on Saturday will be given for women and children, with people allowed to cross every two hours.
On Friday morning, Macedonian police clashed with refugees after the border was sealed for the first time.
"They shoot us today, they shoot us today, I can tell you, I see it. We was in front of the place. Officer people in Macedonia, they shoot the people," a refugee, who did not want to be identified, told Reuters.
Five refugees were taken to a hospital on the Greek side of the border with injuries caused by plastic bullets and tear gas, Doctors Without Borders (MSF) said.
The border reopened for several hours on Friday afternoon but only a few dozen of the more than 3,000 people waiting managed to get through.
Macedonia is a major transit point for refugees trying to get from Greece to other EU countries. At least 44,000 people have arrived over the past two months.
Read: Why Al Jazeera will not say Mediterranean 'migrants'
The flow into Macedonia had reached 1,500-2,000 per day in recent weeks, up from some 200 daily in May, leading to desperate scenes of crowds wrestling to board packed trains at a nearby railway station and children squeezed through open carriage windows.
We are appealing to the EU and other countries to try and find a solution to the problem. It's a global problem
Macedonia justified its actions on Friday, saying it wanted to boost the security of settlements in the area and to deal more efficiently with the rising influx of refugees.
Ivo Kotevsky, a spokesman for the interior ministry, told Al Jazeera that the officers had not used violence against the refugees but had been forced to take measures to protect themselves and the border.
"They are authorised to protect the border and to protect themselves. They were standing on our territory and defending the border," he said.
Kotevsky said Macedonia was trying to do its best in protecting the refugees, who had been "practically expelled from Greece".
"They get treated according to our capacity. We are appealing to the EU and other countries to try and find a solution to the problem. It's a global problem."
The new border controls could create a huge backlog of refugees on the Greek side of the border.
Our correspondent said around 2,500 Syrian refugees who had been transferred on a ferry from Greek islands to Athens were expected to arrive soon at the border.
Until now, the border has been porous, with only a few patrols on each side. Sealing the border would disrupt the so-called Balkan corridor for refugees who begin their journey in Turkey and take boats to Greece.
|Refugees who made it through police blockades rest at the Gevgelija railway station in Macedonia [Reuters]
Meanwhile, at the Macedonian side of the border, thousands of refugees were holed up, waiting to catch trains that would take them to the Serbian border en route to Hungary.
Hungary has begun erecting a fence to try to keep the distraught refugees out.
The United Nations refugee agency (UNHCR) urged the Macedonian government to do more, saying it should allocate a site to accommodate people fleeing war.
UNHCR spokesman Petros Mastakas told Al Jazeera that the refugees included "hundreds of vulnerable persons, children, babies and those with extreme vulnerabilities including medical needs.
"Most of them stay rough in the open air," he said.
|UN official Petros Mastakas said the refugees included "hundreds of vulnerable persons, children, babies and those with extreme vulnerabilities" [Reuters]
|The flow into Macedonia had reached 1,500-2,000 people per day in recent weeks [AP]
Source: Al Jazeera and agencies