Greek riot police struggled to maintain order Thursday after chaotic clashes between asylum-seekers at the country's border with Macedonia, where thousands seeking a new life in the European Union have seen their long trek north brought to an abrupt halt by closed borders and new rules.

At least two people were injured Thursday at the border as hundreds of people rejected by Macedonia — so-called economic migrants — clashed with the Syrians, Afghans and Iraqis that Macedonia is allowing in.

Late Thursday, a group of mainly Iranian migrants with small children agreed to stop manning barricades that prevented refugees from entering Macedonia, and about 300 people crossed the border from the Greek village of Idomeni. Tired of waiting, thousands of refugees then broke through a Greek police cordon, surging to the Macedonian border, which immediately closed again.

Earlier, Police distributed fliers warning the economic migrants that they must leave the border area within three days, and the government implied it would take more drastic action if necessary.

The United Nations refugee agency, UNHCR, voiced "deep concern" about the tensions, urging Greece and Macedonia to manage the border "in a manner consistent with human rights and refugee-protection principles."

The clashes came as Greece faces mounting pressure from its EU partners to ensure better control of its borders and register arriving migrants, or face the prospect that passport checks could be reintroduced for Greek citizens in Europe.

More than 600,000 migrants have flooded into Greece this year, many fleeing conflict in Syria or Iraq. Nearly all have entered the country from nearby Turkey, paying large fees to smuggling gangs who arrange their crossings in small, overcrowded boats. Hundreds of people have drowned this year in the Aegean Sea.

Police say about 6,000 people are stuck at Idomeni, sleeping in a shelter provided by charities, in hundreds of tents or in the fields. About 3,500 are Iranians, Pakistanis and other nationalities not allowed in by Macedonians, while the rest are from Syria, Afghanistan and Iraq.

An Iranian manning the barricade, 45-year-old Saeid Kanani, said he has been trapped at the border for the past two weeks, ever since Macedonia imposed its policy of selective admission.

"We don't have anything against the other people, but we have to cross too," he told The Associated Press. "If we go back home we will be killed. So if I am to die, I might as well die here."

At the same border, a man believed to be from Morocco was fatally electrocuted after touching high-power railway cable when he climbed on top of a train.

On Friday in Brussels, EU interior ministers will discuss the state of border controls in Greece, where authorities say they are doing their best but face inadequate assistance from the EU.

"There are a certain number of improvements that need to be done," European Commission spokesman Margaritis Schinas said Thursday. "We have two weeks to make sure that this is seen, it's tangible, it's happening," before the Commission submits a report on borders to EU leaders on Dec. 17.

In a step forward Thursday, the EU border control agency, Frontex, said it had agreed with Greece to expand its activities to the border with Macedonia, where it will assist with registering migrants, beginning next week.

Greek authorities have been struggling to accurately register all migrants entering the country but mistakes are frequent and some migrants use fake papers. Unable to cope with the torrent of people flowing in this year, countries north of Greece have erected razor-wire fences and reintroduced border controls, casting doubts about the viability of Europe's 26-nation passport-free Schengen travel zone.

Greece's minister for migration policy, Ioannis Mouzalas, told Parliament on Thursday the talk of ejecting the country from the Schengen zone comes mostly from EU members like Hungary, which oppose admitting refugees into the EU.

EU diplomats, briefing reporters on condition of anonymity, underlined that there is no provision in the Schengen rule book for kicking a country out or freezing its membership. But Greece's neighbors could reintroduce border controls for Greek people if the country were deemed to be "seriously neglecting its obligations."

Mouzalas said he hopes to have cleared up the impasse at the Macedonian border in "four or five days."

"The situation in Idomeni must stop," he said. "Obviously, (the solution) will not be a stroll in the woods ... nobody likes to see the use of violence or anything else."

He said work was moving ahead on building migrant screening centers on Greece's Aegean Sea islands. But he added the EU has failed to meet a Greek request for additional equipment for fingerprinting migrants.

Greece's financially-strapped government says it has spent about 1 billion euros ($1.1 billion) addressing the migrant crisis and only received 30 million euros in EU aid. Greek media reported the country requested further emergency funding Thursday from the EU for the immigration crisis.

A day ago, Mouzalas said some in the EU "mistakenly believe that the refugee flow can be controlled from Greece."

"The door is in Turkey. Therefore if the flows are not controlled in Turkey, from the coast of Turkey, it is impossible to control the flows from Greece or any other European Union member," he said.