Hungary will close down its border with Croatia, where it has built a razor-wire fence, to the free flow of migrants from midnight Friday (2200 GMT), the foreign minister said.

Speaking after a meeting of the national security Cabinet, Foreign Minister Peter Szijjarto said that normal border checkpoints between the two countries will remain open, though inspections would be tightened.

"We will introduce stricter controls to be able to block border crossings done illegally," Szijjarto said.

Although Croatia is also a member of the European Union, unlike Hungary it is not part of the Schengen zone of passport-free travel. Migrants could still apply for asylum in Hungary at two border transit zones, Szijjarto said.

Over 383,000 migrants fleeing war and poverty in the Middle East, Africa and Asia have entered Hungary this year, nearly all passing through on their way to Germany and other destinations further west in the EU. The country clamped down on its border with Serbia with a similar fence on Sept. 15 and since then migrants have been taking a detour through Croatia to reach Hungary.

After midnight, many of the migrants already in Croatia are expected to try to head toward Slovenia, another EU country in the Schengen zone, which also shares borders with Hungary and Austria. However, experts fear that many will get stuck in Croatia, which is ill-prepared to provide for them in large numbers.

"There is no way Croatia can cope with ... accommodating and providing for the immediate needs for these people," said Lydia Gall, a researcher for Human Rights Watch in Budapest. "Within days you would end up having tens of thousands of people in Croatia and further down the Western Balkan route, in Serbia and Macedonia."

Hungary decided to order the border clampdown after EU leaders meeting Thursday in Brussels failed to agree on a plan backed by Hungary to send EU forces to block migrants from reaching Greece.

"We know that this is not the best, but only the second-best solution," Szijjarto said about closing the Croatian border.

Hungary's fellow members of the so-called Visegrad Group — Poland, the Czech Republic and Slovakia — are sending dozens of soldiers, police and equipment to support Hungarian forces guarding the border with Croatia.

Hungarian officials said this cooperation would be an example to the rest of the EU regarding joint border protection.