Macedonian police have fired tear gas and stun grenades to drive back refugees trying to cross the border from Greece after they spent a night stranded by an emergency decree that had effectively sealed the Macedonian frontier.

Five injured refugees were taken to a hospital on the Greek side of the border on Friday, Doctors Without Borders (MSF) said.

An MSF spokesman told Al Jazeera that injuries were caused by plastic bullets and tear gas.

Witnesses said the border reopened around 4pm local time (14:00 GMT) after being closed overnight, and refugees were pouring through.

More than 3,000 people had been waiting on the Greek side for the border to open, Al Jazeera's Ivan Corkalo reported from the border town of Idomeni.

Macedonia deployed several hundred policemen and soldiers to secure the frontier.

"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.

Macedonia is one of the major transit points for refugees trying to get from Greece to other EU countries. At least 44,000 have arrived over the last two months.

Refugees from the Middle East, Africa and Asia, many of them Syrians, spent a cold night on the border on Thursday as Macedonia declared a state of emergency and effectively blocked its southern frontier to refugees.

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.

Police in riot gear fired tear gas and stun grenades, sending up clouds of smoke, as hundreds of refugees, including women and children, gathered at the border fence.

We are appealing to the EU and other countries to try and find a solution to the problem. It's a global problem Ivo Kotevsky, interior ministry spokesman Macedonia justified its moves on Friday, saying it wanted to boost the security of settlements in the area and to deal more efficiently with the rising number 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."

In a statement, the ministry earlier said it had admitted 181 foreign nationals overnight - "a limited number of migrants of vulnerable categories who could be adequately treated in line with the country's capacities".

The new border controls could create a huge backlog of refugees on the Greek side of 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.

'Escape from death'

Thousands of refugees were holed up in the Macedonian town of Gevgelija, from where they planned to catch trains that would take them to the Serbian border en route to Hungary.

"We can't believe that we are here from this morning," Ahmet Husa of Syria told Reuters. "People from Syria escaped from war, escaped death and we want to see our future in Europe. We need this road to see our future."

Hungary has begun erecting a fence to try to keep the distraught refugees out.

Macedonia appealed on Wednesday for neighbouring countries to send train carriages to address the demand.

The UN refugee agency also urged the government to do more, saying it should allocate a site to accommodate people fleeing war.

"Depending on how Greece uses ships to decongest the islands, that will also temporarily increase the arrivals here," said Alexandra Krause, senior protection officer at the UNHCR in the Macedonian capital, Skopje.

Refugees desperate to board train in Macedonia

"The Macedonian government needs to provide an appropriate site to be able to shelter the arrivals properly and to ensure sufficient assistance," Krause told Reuters.

The only site currently being used is the local police station, where Krause said the UNHCR had constructed some shelter with a capacity for just 165 people.

Krause said the Red Cross had access to the refugees in the border area but warned of harsher weather approaching.