Macedonia declared a state of emergency Thursday and will send troops to its border with Greece to stop illegal migrants from pouring into the country.
The move has stranded about 1,500 men, women, and children in a no-man's land between the two countries in the dangerously high summer heat.
Around 2,000 migrants a day have been crossing into Macedonia from Greece and the economically-poor country is struggling to handle the flow.
Interior Ministry spokesman Ivo Kotevski said deploying soldiers to the border is the best solution for the migrants and the Macedonian people.
"It will increase security among our citizens in the two regions and will allow a more comprehensive approach towards people expressing their interest in applying for asylum in Macedonia according to capacity and to international obligations signed by Macedonia, which we want to respect."
Nearly all the migrants are from Afghanistan, Iraq, and Syria. They are trying to flee war, terrorism, and poverty for a better life in the wealthier European Union.
A Syrian man told The Associated Press that "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."
The U.N. says more than 160,000 migrants have arrived in Greece so far this year. They are trying to make it to EU countries by foot or train through Macedonia and Serbia.
Many of the migrants say there is an extra urgency right now to get to the West before Hungary completes a fence along its borders.
Watch RFE/RFL video of migrants stuck at the Macedonian-Greek border: